( obj: Record<string, T>, map: (key: string, value: T) => string, )
| 22 | }; |
| 23 | |
| 24 | export const mapKeys = <T>( |
| 25 | obj: Record<string, T>, |
| 26 | map: (key: string, value: T) => string, |
| 27 | ): Record<string, T> => { |
| 28 | const result = Object.fromEntries( |
| 29 | Object.entries(obj).map(([key, val]) => { |
| 30 | const newKey = map(key, val); |
| 31 | return [newKey, val]; |
| 32 | }), |
| 33 | ); |
| 34 | return result; |
| 35 | }; |
| 36 | |
| 37 | export const mapEntries = <T>( |
| 38 | obj: Record<string, T>, |
no outgoing calls
no test coverage detected