if (Array.isArray(schema))
return validateTuple(cxt, "additionalItems", schema);
it.items = true;
- if (util_1.alwaysValidSchema(it, schema))
+ if ((0, util_1.alwaysValidSchema)(it, schema))
return;
- cxt.ok(code_1.validateArray(cxt));
+ cxt.ok((0, code_1.validateArray)(cxt));
},
};
function validateTuple(cxt, extraItems, schArr = cxt.schema) {
it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
}
const valid = gen.name("valid");
- const len = gen.const("len", codegen_1._ `${data}.length`);
+ const len = gen.const("len", (0, codegen_1._) `${data}.length`);
schArr.forEach((sch, i) => {
- if (util_1.alwaysValidSchema(it, sch))
+ if ((0, util_1.alwaysValidSchema)(it, sch))
return;
- gen.if(codegen_1._ `${len} > ${i}`, () => cxt.subschema({
+ gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({
keyword,
schemaProp: i,
dataProp: i,
cxt.ok(valid);
});
function checkStrictTuple(sch) {
+ const { opts, errSchemaPath } = it;
const l = schArr.length;
const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
- if (it.opts.strictTuples && !fullTuple) {
- const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different`;
- util_1.checkStrictMode(it, msg, it.opts.strictTuples);
+ if (opts.strictTuples && !fullTuple) {
+ const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
+ (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
}
}
}