Refactor settings code; Add props access to every settings item

This commit is contained in:
MauriceNino
2023-02-14 13:41:59 +01:00
parent 4c2c2fb564
commit d8931644d8
4 changed files with 62 additions and 36 deletions

View 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)]));