mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Upgrade to React 18
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function objectMap<T>(
|
||||
export function objectMap<T, R>(
|
||||
obj: Record<string, T>,
|
||||
f: (key: keyof typeof obj, value: (typeof obj)[keyof typeof obj]) => unknown
|
||||
): Array<unknown> {
|
||||
f: (key: keyof typeof obj, value: (typeof obj)[keyof typeof obj]) => R
|
||||
): Array<R> {
|
||||
const keys: Array<keyof typeof obj> = Object.keys(obj);
|
||||
return keys.map(key => f(key, obj[key]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user