swc/crates/swc_bundler/tests/.cache/deno/bb6867af5d41b661e35987b3b1cbe5d7c968b500.ts
2021-11-09 20:42:49 +09:00

18 lines
411 B
TypeScript

// Loaded from https://deno.land/x/graphql_deno@v15.0.0/lib/jsutils/toObjMap.js
import objectEntries from '../polyfills/objectEntries.js';
export default function toObjMap(obj) {
/* eslint-enable no-redeclare */
if (Object.getPrototypeOf(obj) === null) {
return obj;
}
const map = Object.create(null);
for (const [key, value] of objectEntries(obj)) {
map[key] = value;
}
return map;
}