mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-17 04:52:15 +01:00
6 lines
219 B
TypeScript
6 lines
219 B
TypeScript
export const mapObject = <T, R>(
|
|
items: Record<string, T>,
|
|
mapper: (prop: string, item: T) => R
|
|
): Record<string, R> =>
|
|
Object.fromEntries(Object.entries(items).map(([name, item]) => [name, mapper(name, item)]));
|