mirror of
https://github.com/swc-project/swc.git
synced 2025-01-02 10:37:56 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
18 lines
411 B
TypeScript
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;
|
|
} |