MCPcopy Create free account
hub / github.com/EvoMap/evolver / safeAssign

Function safeAssign

src/proxy/mailbox/store.js:26–35  ·  view source on GitHub ↗
(target, fields)

Source from the content-addressed store, hash-verified

24// __proto__/constructor/prototype could pollute Object.prototype during
25// _rebuildIndex (see GHSA-2cjr-5v3h-v2w4).
26function safeAssign(target, fields) {
27 if (!fields || typeof fields !== 'object') return target;
28 const keys = Object.keys(fields);
29 for (let i = 0; i < keys.length; i++) {
30 const k = keys[i];
31 if (k === '__proto__' || k === 'constructor' || k === 'prototype') continue;
32 target[k] = fields[k];
33 }
34 return target;
35}
36
37function sanitizeRow(row) {
38 if (!row || typeof row !== 'object') return row;

Callers 3

sanitizeRowFunction · 0.85
_rebuildIndexMethod · 0.85
_appendUpdateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected