source: trip-planner-front/node_modules/ajv/lib/vocabularies/applicator/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: 1.6 KB
Line 
1import type {ErrorNoParams, Vocabulary} from "../../types"
2import additionalItems, {AdditionalItemsError} from "./additionalItems"
3import prefixItems from "./prefixItems"
4import items from "./items"
5import items2020, {ItemsError} from "./items2020"
6import contains, {ContainsError} from "./contains"
7import dependencies, {DependenciesError} from "./dependencies"
8import propertyNames, {PropertyNamesError} from "./propertyNames"
9import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties"
10import properties from "./properties"
11import patternProperties from "./patternProperties"
12import notKeyword, {NotKeywordError} from "./not"
13import anyOf, {AnyOfError} from "./anyOf"
14import oneOf, {OneOfError} from "./oneOf"
15import allOf from "./allOf"
16import ifKeyword, {IfKeywordError} from "./if"
17import thenElse from "./thenElse"
18
19export default function getApplicator(draft2020 = false): Vocabulary {
20 const applicator = [
21 // any
22 notKeyword,
23 anyOf,
24 oneOf,
25 allOf,
26 ifKeyword,
27 thenElse,
28 // object
29 propertyNames,
30 additionalProperties,
31 dependencies,
32 properties,
33 patternProperties,
34 ]
35 // array
36 if (draft2020) applicator.push(prefixItems, items2020)
37 else applicator.push(additionalItems, items)
38 applicator.push(contains)
39 return applicator
40}
41
42export type ApplicatorKeywordError =
43 | ErrorNoParams<"false schema">
44 | AdditionalItemsError
45 | ItemsError
46 | ContainsError
47 | AdditionalPropertiesError
48 | DependenciesError
49 | IfKeywordError
50 | AnyOfError
51 | OneOfError
52 | NotKeywordError
53 | PropertyNamesError
Note: See TracBrowser for help on using the repository browser.