source: trip-planner-front/node_modules/ajv/lib/vocabularies/validation/index.ts@ 6c1585f

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

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import type {ErrorObject, Vocabulary} from "../../types"
2import limitNumber, {LimitNumberError} from "./limitNumber"
3import multipleOf, {MultipleOfError} from "./multipleOf"
4import limitLength from "./limitLength"
5import pattern, {PatternError} from "./pattern"
6import limitProperties from "./limitProperties"
7import required, {RequiredError} from "./required"
8import limitItems from "./limitItems"
9import uniqueItems, {UniqueItemsError} from "./uniqueItems"
10import constKeyword, {ConstError} from "./const"
11import enumKeyword, {EnumError} from "./enum"
12
13const validation: Vocabulary = [
14 // number
15 limitNumber,
16 multipleOf,
17 // string
18 limitLength,
19 pattern,
20 // object
21 limitProperties,
22 required,
23 // array
24 limitItems,
25 uniqueItems,
26 // any
27 {keyword: "type", schemaType: ["string", "array"]},
28 {keyword: "nullable", schemaType: "boolean"},
29 constKeyword,
30 enumKeyword,
31]
32
33export default validation
34
35type LimitError = ErrorObject<
36 "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength",
37 {limit: number},
38 number | {$data: string}
39>
40
41export type ValidationKeywordError =
42 | LimitError
43 | LimitNumberError
44 | MultipleOfError
45 | PatternError
46 | RequiredError
47 | UniqueItemsError
48 | ConstError
49 | EnumError
Note: See TracBrowser for help on using the repository browser.