swc/bundler/tests/.cache/deno/6aa66eeb2703c40acaa7e5a16c042c7f9d19b387.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

18 lines
460 B
TypeScript

// Loaded from https://deno.land/x/graphql_deno@v15.0.0/lib/jsutils/mapValue.js
import objectEntries from '../polyfills/objectEntries.js';
/**
* Creates an object map with the same keys as `map` and values generated by
* running each value of `map` thru `fn`.
*/
export default function mapValue(map, fn) {
const result = Object.create(null);
for (const [key, value] of objectEntries(map)) {
result[key] = fn(value, key);
}
return result;
}