MCPcopy Create free account
hub / github.com/node-modules/utility / map

Function map

src/object.ts:60–72  ·  view source on GitHub ↗
(obj?: any)

Source from the content-addressed store, hash-verified

58 * @param {Object} [obj] - init object, optional
59 */
60export function map(obj?: any): Record<string, any> {
61 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
62 // @ts-ignore
63 const newObj = new EmptyObject() as Record<string, any>;
64 if (!obj) {
65 return newObj;
66 }
67
68 for (const key in obj) {
69 newObj[key] = obj[key];
70 }
71 return newObj;
72}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected