MCPcopy Create free account
hub / github.com/json-editor/json-editor / replaceName

Function replaceName

docs/scripts/ajv-validator.js:1366–1372  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

1364 return items;
1365 }, []));
1366 function replaceName(n) {
1367 const c = constants[n.str];
1368 if (c === undefined || names[n.str] !== 1)
1369 return n;
1370 delete names[n.str];
1371 return c;
1372 }
1373 function canOptimize(e) {
1374 return (e instanceof code_1._Code &&
1375 e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));

Callers 1

optimizeExprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected