export function objectMap( input: O, mapper: (value: X, key: string) => V ): {[P in keyof O]: V} { const output: any = {} for (const [key, value] of Object.entries(input)) output[key] = mapper(value, key) return output }