main
ts 9 lines 249 Bytes
Raw
1 export function toObject <T, R> (map: Map<string, T>, transform: (value: T) => R): Record<string, R> {
2 const output: Record<string, any> = {}
3
4 for (const [key, value] of map.entries()) {
5 output[key] = transform(value)
6 }
7
8 return output
9 }