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

Function validateUniqueItems

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

Source from the content-addressed store, hash-verified

6957 cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);
6958 cxt.ok(valid);
6959 function validateUniqueItems() {
6960 const i = gen.let("i", (0, codegen_1._) `${data}.length`);
6961 const j = gen.let("j");
6962 cxt.setParams({ i, j });
6963 gen.assign(valid, true);
6964 gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
6965 }
6966 function canOptimize() {
6967 return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
6968 }

Callers

nothing calls this directly

Calls 5

canOptimizeFunction · 0.85
letMethod · 0.80
setParamsMethod · 0.80
assignMethod · 0.80
ifMethod · 0.45

Tested by

no test coverage detected