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

Method optimizeNodes

docs/scripts/ajv-validator.js:860–873  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

858 return this.nodes.reduce((code, n) => code + n.render(opts), "");
859 }
860 optimizeNodes() {
861 const { nodes } = this;
862 let i = nodes.length;
863 while (i--) {
864 const n = nodes[i].optimizeNodes();
865 if (Array.isArray(n))
866 nodes.splice(i, 1, ...n);
867 else if (n)
868 nodes[i] = n;
869 else
870 nodes.splice(i, 1);
871 }
872 return nodes.length > 0 ? this : undefined;
873 }
874 optimizeNames(names, constants) {
875 const { nodes } = this;
876 let i = nodes.length;

Callers

nothing calls this directly

Calls 1

optimizeNodesMethod · 0.45

Tested by

no test coverage detected