Create text stories
This commit is contained in:
parent
973b2264fe
commit
d970d427f8
53 changed files with 2433 additions and 1106 deletions
10
ts/util/objectMap.ts
Normal file
10
ts/util/objectMap.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function objectMap<T>(
|
||||
obj: Record<string, T>,
|
||||
f: (key: keyof typeof obj, value: typeof obj[keyof typeof obj]) => unknown
|
||||
): Array<unknown> {
|
||||
const keys: Array<keyof typeof obj> = Object.keys(obj);
|
||||
return keys.map(key => f(key, obj[key]));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue