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

Method optimizeNames

docs/scripts/ajv-validator.js:780–785  ·  view source on GitHub ↗
(names, constants)

Source from the content-addressed store, hash-verified

778 return `${this.lhs} = ${this.rhs};` + _n;
779 }
780 optimizeNames(names, constants) {
781 if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
782 return;
783 this.rhs = optimizeExpr(this.rhs, names, constants);
784 return this;
785 }
786 get names() {
787 const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
788 return addExprNames(names, this.rhs);

Callers

nothing calls this directly

Calls 1

optimizeExprFunction · 0.85

Tested by

no test coverage detected