mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-17 13:02:18 +01:00
Refactor settings code; Add props access to every settings item
This commit is contained in:
5
src/tools/client/objects.ts
Normal file
5
src/tools/client/objects.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
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)]));
|
||||
Reference in New Issue
Block a user