UNPKG

cynic

Version:

async testing framework for es-modules

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