source: trip-planner-front/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts

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

initial commit

  • Property mode set to 100644
File size: 982 bytes
Line 
1import type Ajv from "../../core"
2import type {AnySchemaObject} from "../../types"
3import * as metaSchema from "./schema.json"
4import * as applicator from "./meta/applicator.json"
5import * as unevaluated from "./meta/unevaluated.json"
6import * as content from "./meta/content.json"
7import * as core from "./meta/core.json"
8import * as format from "./meta/format-annotation.json"
9import * as metadata from "./meta/meta-data.json"
10import * as validation from "./meta/validation.json"
11
12const META_SUPPORT_DATA = ["/properties"]
13
14export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv {
15 ;[
16 metaSchema,
17 applicator,
18 unevaluated,
19 content,
20 core,
21 with$data(this, format),
22 metadata,
23 with$data(this, validation),
24 ].forEach((sch) => this.addMetaSchema(sch, undefined, false))
25 return this
26
27 function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject {
28 return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch
29 }
30}
Note: See TracBrowser for help on using the repository browser.