mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
18 lines
460 B
TypeScript
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;
|
|
} |