source: trip-planner-front/node_modules/ajv/lib/vocabularies/applicator/allOf.ts@ bdd6491

Last change on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 717 bytes
Line 
1import type {CodeKeywordDefinition, AnySchema} from "../../types"
2import type {KeywordCxt} from "../../compile/validate"
3import {alwaysValidSchema} from "../../compile/util"
4
5const def: CodeKeywordDefinition = {
6 keyword: "allOf",
7 schemaType: "array",
8 code(cxt: KeywordCxt) {
9 const {gen, schema, it} = cxt
10 /* istanbul ignore if */
11 if (!Array.isArray(schema)) throw new Error("ajv implementation error")
12 const valid = gen.name("valid")
13 schema.forEach((sch: AnySchema, i: number) => {
14 if (alwaysValidSchema(it, sch)) return
15 const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid)
16 cxt.ok(valid)
17 cxt.mergeEvaluated(schCxt)
18 })
19 },
20}
21
22export default def
Note: See TracBrowser for help on using the repository browser.