@alexlit/lint-kit 117.3.1 → 117.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/config-eslint/package.json +7 -11
- package/packages/config-eslint/plugins/no-await-in-promise.js +1 -1
- package/packages/config-eslint/utils/create-config.js +3 -3
- package/packages/config-hooks/package.json +2 -2
- package/scripts/.config.sh +1 -1
- package/packages/config-eslint/node_modules/@eslint/eslintrc/LICENSE +0 -19
- package/packages/config-eslint/node_modules/@eslint/eslintrc/README.md +0 -126
- package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/config-schema.js +0 -79
- package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/environments.js +0 -215
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1143
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4371
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +0 -532
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +0 -510
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +0 -124
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +0 -145
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +0 -238
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js +0 -19
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +0 -225
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js +0 -1155
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js +0 -318
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index-universal.js +0 -29
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index.js +0 -58
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js +0 -191
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +0 -135
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +0 -370
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +0 -63
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js +0 -96
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +0 -42
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/types.js +0 -149
- package/packages/config-eslint/node_modules/@eslint/eslintrc/package.json +0 -82
- package/packages/config-eslint/node_modules/@eslint/eslintrc/universal.js +0 -9
- package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
- package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
- package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
- package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
- package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
- package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
- package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
- package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
- package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
- package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
- package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
- package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
- package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
- package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
- package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
- package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
- package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
- package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
- package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
- package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
- package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
- package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
- package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
- package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
- package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
- package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
- package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
- package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
- package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
- package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
- package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
- package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
- package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
- package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
- package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
- package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
- package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
- package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
- package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
- package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
- package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
- package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
- package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
- package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
- package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
- package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
- package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
- package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
- package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
- package/packages/config-eslint/node_modules/ajv/package.json +0 -106
- package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
- package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
- package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
- package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
- package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
- package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
- package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
- package/packages/config-eslint/node_modules/eslint-visitor-keys/LICENSE +0 -201
- package/packages/config-eslint/node_modules/eslint-visitor-keys/README.md +0 -105
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +0 -384
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +0 -27
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/index.d.ts +0 -16
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +0 -12
- package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/index.js +0 -65
- package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js +0 -315
- package/packages/config-eslint/node_modules/eslint-visitor-keys/package.json +0 -74
- package/packages/config-eslint/node_modules/espree/LICENSE +0 -25
- package/packages/config-eslint/node_modules/espree/README.md +0 -244
- package/packages/config-eslint/node_modules/espree/dist/espree.cjs +0 -883
- package/packages/config-eslint/node_modules/espree/espree.js +0 -177
- package/packages/config-eslint/node_modules/espree/lib/espree.js +0 -349
- package/packages/config-eslint/node_modules/espree/lib/features.js +0 -27
- package/packages/config-eslint/node_modules/espree/lib/options.js +0 -123
- package/packages/config-eslint/node_modules/espree/lib/token-translator.js +0 -263
- package/packages/config-eslint/node_modules/espree/lib/version.js +0 -3
- package/packages/config-eslint/node_modules/espree/package.json +0 -86
- package/packages/config-eslint/node_modules/globals/globals.json +0 -1998
- package/packages/config-eslint/node_modules/globals/index.d.ts +0 -2077
- package/packages/config-eslint/node_modules/globals/index.js +0 -2
- package/packages/config-eslint/node_modules/globals/license +0 -9
- package/packages/config-eslint/node_modules/globals/package.json +0 -58
- package/packages/config-eslint/node_modules/globals/readme.md +0 -44
- package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
- package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
- package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
- package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
- package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
- package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.setupNextLevel }}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{{## def.validateItems:startFrom:
|
|
8
|
-
for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) {
|
|
9
|
-
{{
|
|
10
|
-
$it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
|
|
11
|
-
var $passData = $data + '[' + $idx + ']';
|
|
12
|
-
$it.dataPathArr[$dataNxt] = $idx;
|
|
13
|
-
}}
|
|
14
|
-
|
|
15
|
-
{{# def.generateSubschemaCode }}
|
|
16
|
-
{{# def.optimizeValidate }}
|
|
17
|
-
|
|
18
|
-
{{? $breakOnError }}
|
|
19
|
-
if (!{{=$nextValid}}) break;
|
|
20
|
-
{{?}}
|
|
21
|
-
}
|
|
22
|
-
#}}
|
|
23
|
-
|
|
24
|
-
{{
|
|
25
|
-
var $idx = 'i' + $lvl
|
|
26
|
-
, $dataNxt = $it.dataLevel = it.dataLevel + 1
|
|
27
|
-
, $nextData = 'data' + $dataNxt
|
|
28
|
-
, $currentBaseId = it.baseId;
|
|
29
|
-
}}
|
|
30
|
-
|
|
31
|
-
var {{=$errs}} = errors;
|
|
32
|
-
var {{=$valid}};
|
|
33
|
-
|
|
34
|
-
{{? Array.isArray($schema) }}
|
|
35
|
-
{{ /* 'items' is an array of schemas */}}
|
|
36
|
-
{{ var $additionalItems = it.schema.additionalItems; }}
|
|
37
|
-
{{? $additionalItems === false }}
|
|
38
|
-
{{=$valid}} = {{=$data}}.length <= {{= $schema.length }};
|
|
39
|
-
{{
|
|
40
|
-
var $currErrSchemaPath = $errSchemaPath;
|
|
41
|
-
$errSchemaPath = it.errSchemaPath + '/additionalItems';
|
|
42
|
-
}}
|
|
43
|
-
{{# def.checkError:'additionalItems' }}
|
|
44
|
-
{{ $errSchemaPath = $currErrSchemaPath; }}
|
|
45
|
-
{{# def.elseIfValid}}
|
|
46
|
-
{{?}}
|
|
47
|
-
|
|
48
|
-
{{~ $schema:$sch:$i }}
|
|
49
|
-
{{? {{# def.nonEmptySchema:$sch }} }}
|
|
50
|
-
{{=$nextValid}} = true;
|
|
51
|
-
|
|
52
|
-
if ({{=$data}}.length > {{=$i}}) {
|
|
53
|
-
{{
|
|
54
|
-
var $passData = $data + '[' + $i + ']';
|
|
55
|
-
$it.schema = $sch;
|
|
56
|
-
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
57
|
-
$it.errSchemaPath = $errSchemaPath + '/' + $i;
|
|
58
|
-
$it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
|
|
59
|
-
$it.dataPathArr[$dataNxt] = $i;
|
|
60
|
-
}}
|
|
61
|
-
|
|
62
|
-
{{# def.generateSubschemaCode }}
|
|
63
|
-
{{# def.optimizeValidate }}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
{{# def.ifResultValid }}
|
|
67
|
-
{{?}}
|
|
68
|
-
{{~}}
|
|
69
|
-
|
|
70
|
-
{{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }}
|
|
71
|
-
{{
|
|
72
|
-
$it.schema = $additionalItems;
|
|
73
|
-
$it.schemaPath = it.schemaPath + '.additionalItems';
|
|
74
|
-
$it.errSchemaPath = it.errSchemaPath + '/additionalItems';
|
|
75
|
-
}}
|
|
76
|
-
{{=$nextValid}} = true;
|
|
77
|
-
|
|
78
|
-
if ({{=$data}}.length > {{= $schema.length }}) {
|
|
79
|
-
{{# def.validateItems: $schema.length }}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
{{# def.ifResultValid }}
|
|
83
|
-
{{?}}
|
|
84
|
-
|
|
85
|
-
{{?? {{# def.nonEmptySchema:$schema }} }}
|
|
86
|
-
{{ /* 'items' is a single schema */}}
|
|
87
|
-
{{
|
|
88
|
-
$it.schema = $schema;
|
|
89
|
-
$it.schemaPath = $schemaPath;
|
|
90
|
-
$it.errSchemaPath = $errSchemaPath;
|
|
91
|
-
}}
|
|
92
|
-
{{# def.validateItems: 0 }}
|
|
93
|
-
{{?}}
|
|
94
|
-
|
|
95
|
-
{{? $breakOnError }}
|
|
96
|
-
{{= $closingBraces }}
|
|
97
|
-
if ({{=$errs}} == errors) {
|
|
98
|
-
{{?}}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{{## def.checkMissingProperty:_properties:
|
|
2
|
-
{{~ _properties:$propertyKey:$i }}
|
|
3
|
-
{{?$i}} || {{?}}
|
|
4
|
-
{{
|
|
5
|
-
var $prop = it.util.getProperty($propertyKey)
|
|
6
|
-
, $useData = $data + $prop;
|
|
7
|
-
}}
|
|
8
|
-
( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) )
|
|
9
|
-
{{~}}
|
|
10
|
-
#}}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{{## def.errorMissingProperty:_error:
|
|
14
|
-
{{
|
|
15
|
-
var $propertyPath = 'missing' + $lvl
|
|
16
|
-
, $missingProperty = '\' + ' + $propertyPath + ' + \'';
|
|
17
|
-
if (it.opts._errorDataPathProperty) {
|
|
18
|
-
it.errorPath = it.opts.jsonPointers
|
|
19
|
-
? it.util.getPathExpr($currentErrorPath, $propertyPath, true)
|
|
20
|
-
: $currentErrorPath + ' + ' + $propertyPath;
|
|
21
|
-
}
|
|
22
|
-
}}
|
|
23
|
-
{{# def.error:_error }}
|
|
24
|
-
#}}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{{## def.allErrorsMissingProperty:_error:
|
|
28
|
-
{{
|
|
29
|
-
var $prop = it.util.getProperty($propertyKey)
|
|
30
|
-
, $missingProperty = it.util.escapeQuotes($propertyKey)
|
|
31
|
-
, $useData = $data + $prop;
|
|
32
|
-
if (it.opts._errorDataPathProperty) {
|
|
33
|
-
it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
|
|
34
|
-
}
|
|
35
|
-
}}
|
|
36
|
-
if ({{# def.noPropertyInData }}) {
|
|
37
|
-
{{# def.addError:_error }}
|
|
38
|
-
}
|
|
39
|
-
#}}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.$data }}
|
|
5
|
-
|
|
6
|
-
{{# def.numberKeyword }}
|
|
7
|
-
|
|
8
|
-
var division{{=$lvl}};
|
|
9
|
-
if ({{?$isData}}
|
|
10
|
-
{{=$schemaValue}} !== undefined && (
|
|
11
|
-
typeof {{=$schemaValue}} != 'number' ||
|
|
12
|
-
{{?}}
|
|
13
|
-
(division{{=$lvl}} = {{=$data}} / {{=$schemaValue}},
|
|
14
|
-
{{? it.opts.multipleOfPrecision }}
|
|
15
|
-
Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}}
|
|
16
|
-
{{??}}
|
|
17
|
-
division{{=$lvl}} !== parseInt(division{{=$lvl}})
|
|
18
|
-
{{?}}
|
|
19
|
-
)
|
|
20
|
-
{{?$isData}} ) {{?}} ) {
|
|
21
|
-
{{# def.error:'multipleOf' }}
|
|
22
|
-
} {{? $breakOnError }} else { {{?}}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.setupNextLevel }}
|
|
5
|
-
|
|
6
|
-
{{? {{# def.nonEmptySchema:$schema }} }}
|
|
7
|
-
{{
|
|
8
|
-
$it.schema = $schema;
|
|
9
|
-
$it.schemaPath = $schemaPath;
|
|
10
|
-
$it.errSchemaPath = $errSchemaPath;
|
|
11
|
-
}}
|
|
12
|
-
|
|
13
|
-
var {{=$errs}} = errors;
|
|
14
|
-
|
|
15
|
-
{{# def.setCompositeRule }}
|
|
16
|
-
|
|
17
|
-
{{
|
|
18
|
-
$it.createErrors = false;
|
|
19
|
-
var $allErrorsOption;
|
|
20
|
-
if ($it.opts.allErrors) {
|
|
21
|
-
$allErrorsOption = $it.opts.allErrors;
|
|
22
|
-
$it.opts.allErrors = false;
|
|
23
|
-
}
|
|
24
|
-
}}
|
|
25
|
-
{{= it.validate($it) }}
|
|
26
|
-
{{
|
|
27
|
-
$it.createErrors = true;
|
|
28
|
-
if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
|
|
29
|
-
}}
|
|
30
|
-
|
|
31
|
-
{{# def.resetCompositeRule }}
|
|
32
|
-
|
|
33
|
-
if ({{=$nextValid}}) {
|
|
34
|
-
{{# def.error:'not' }}
|
|
35
|
-
} else {
|
|
36
|
-
{{# def.resetErrors }}
|
|
37
|
-
{{? it.opts.allErrors }} } {{?}}
|
|
38
|
-
{{??}}
|
|
39
|
-
{{# def.addError:'not' }}
|
|
40
|
-
{{? $breakOnError}}
|
|
41
|
-
if (false) {
|
|
42
|
-
{{?}}
|
|
43
|
-
{{?}}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.setupNextLevel }}
|
|
5
|
-
|
|
6
|
-
{{
|
|
7
|
-
var $currentBaseId = $it.baseId
|
|
8
|
-
, $prevValid = 'prevValid' + $lvl
|
|
9
|
-
, $passingSchemas = 'passingSchemas' + $lvl;
|
|
10
|
-
}}
|
|
11
|
-
|
|
12
|
-
var {{=$errs}} = errors
|
|
13
|
-
, {{=$prevValid}} = false
|
|
14
|
-
, {{=$valid}} = false
|
|
15
|
-
, {{=$passingSchemas}} = null;
|
|
16
|
-
|
|
17
|
-
{{# def.setCompositeRule }}
|
|
18
|
-
|
|
19
|
-
{{~ $schema:$sch:$i }}
|
|
20
|
-
{{? {{# def.nonEmptySchema:$sch }} }}
|
|
21
|
-
{{
|
|
22
|
-
$it.schema = $sch;
|
|
23
|
-
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
24
|
-
$it.errSchemaPath = $errSchemaPath + '/' + $i;
|
|
25
|
-
}}
|
|
26
|
-
|
|
27
|
-
{{# def.insertSubschemaCode }}
|
|
28
|
-
{{??}}
|
|
29
|
-
var {{=$nextValid}} = true;
|
|
30
|
-
{{?}}
|
|
31
|
-
|
|
32
|
-
{{? $i }}
|
|
33
|
-
if ({{=$nextValid}} && {{=$prevValid}}) {
|
|
34
|
-
{{=$valid}} = false;
|
|
35
|
-
{{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}];
|
|
36
|
-
} else {
|
|
37
|
-
{{ $closingBraces += '}'; }}
|
|
38
|
-
{{?}}
|
|
39
|
-
|
|
40
|
-
if ({{=$nextValid}}) {
|
|
41
|
-
{{=$valid}} = {{=$prevValid}} = true;
|
|
42
|
-
{{=$passingSchemas}} = {{=$i}};
|
|
43
|
-
}
|
|
44
|
-
{{~}}
|
|
45
|
-
|
|
46
|
-
{{# def.resetCompositeRule }}
|
|
47
|
-
|
|
48
|
-
{{= $closingBraces }}
|
|
49
|
-
|
|
50
|
-
if (!{{=$valid}}) {
|
|
51
|
-
{{# def.extraError:'oneOf' }}
|
|
52
|
-
} else {
|
|
53
|
-
{{# def.resetErrors }}
|
|
54
|
-
{{? it.opts.allErrors }} } {{?}}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.$data }}
|
|
5
|
-
|
|
6
|
-
{{
|
|
7
|
-
var $regexp = $isData
|
|
8
|
-
? '(new RegExp(' + $schemaValue + '))'
|
|
9
|
-
: it.usePattern($schema);
|
|
10
|
-
}}
|
|
11
|
-
|
|
12
|
-
if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
|
|
13
|
-
{{# def.error:'pattern' }}
|
|
14
|
-
} {{? $breakOnError }} else { {{?}}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.setupNextLevel }}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{{## def.validateAdditional:
|
|
8
|
-
{{ /* additionalProperties is schema */
|
|
9
|
-
$it.schema = $aProperties;
|
|
10
|
-
$it.schemaPath = it.schemaPath + '.additionalProperties';
|
|
11
|
-
$it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
|
|
12
|
-
$it.errorPath = it.opts._errorDataPathProperty
|
|
13
|
-
? it.errorPath
|
|
14
|
-
: it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
|
|
15
|
-
var $passData = $data + '[' + $key + ']';
|
|
16
|
-
$it.dataPathArr[$dataNxt] = $key;
|
|
17
|
-
}}
|
|
18
|
-
|
|
19
|
-
{{# def.generateSubschemaCode }}
|
|
20
|
-
{{# def.optimizeValidate }}
|
|
21
|
-
#}}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{{
|
|
25
|
-
var $key = 'key' + $lvl
|
|
26
|
-
, $idx = 'idx' + $lvl
|
|
27
|
-
, $dataNxt = $it.dataLevel = it.dataLevel + 1
|
|
28
|
-
, $nextData = 'data' + $dataNxt
|
|
29
|
-
, $dataProperties = 'dataProperties' + $lvl;
|
|
30
|
-
|
|
31
|
-
var $schemaKeys = Object.keys($schema || {}).filter(notProto)
|
|
32
|
-
, $pProperties = it.schema.patternProperties || {}
|
|
33
|
-
, $pPropertyKeys = Object.keys($pProperties).filter(notProto)
|
|
34
|
-
, $aProperties = it.schema.additionalProperties
|
|
35
|
-
, $someProperties = $schemaKeys.length || $pPropertyKeys.length
|
|
36
|
-
, $noAdditional = $aProperties === false
|
|
37
|
-
, $additionalIsSchema = typeof $aProperties == 'object'
|
|
38
|
-
&& Object.keys($aProperties).length
|
|
39
|
-
, $removeAdditional = it.opts.removeAdditional
|
|
40
|
-
, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional
|
|
41
|
-
, $ownProperties = it.opts.ownProperties
|
|
42
|
-
, $currentBaseId = it.baseId;
|
|
43
|
-
|
|
44
|
-
var $required = it.schema.required;
|
|
45
|
-
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
|
|
46
|
-
var $requiredHash = it.util.toHash($required);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function notProto(p) { return p !== '__proto__'; }
|
|
50
|
-
}}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var {{=$errs}} = errors;
|
|
54
|
-
var {{=$nextValid}} = true;
|
|
55
|
-
{{? $ownProperties }}
|
|
56
|
-
var {{=$dataProperties}} = undefined;
|
|
57
|
-
{{?}}
|
|
58
|
-
|
|
59
|
-
{{? $checkAdditional }}
|
|
60
|
-
{{# def.iterateProperties }}
|
|
61
|
-
{{? $someProperties }}
|
|
62
|
-
var isAdditional{{=$lvl}} = !(false
|
|
63
|
-
{{? $schemaKeys.length }}
|
|
64
|
-
{{? $schemaKeys.length > 8 }}
|
|
65
|
-
|| validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}})
|
|
66
|
-
{{??}}
|
|
67
|
-
{{~ $schemaKeys:$propertyKey }}
|
|
68
|
-
|| {{=$key}} == {{= it.util.toQuotedString($propertyKey) }}
|
|
69
|
-
{{~}}
|
|
70
|
-
{{?}}
|
|
71
|
-
{{?}}
|
|
72
|
-
{{? $pPropertyKeys.length }}
|
|
73
|
-
{{~ $pPropertyKeys:$pProperty:$i }}
|
|
74
|
-
|| {{= it.usePattern($pProperty) }}.test({{=$key}})
|
|
75
|
-
{{~}}
|
|
76
|
-
{{?}}
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
if (isAdditional{{=$lvl}}) {
|
|
80
|
-
{{?}}
|
|
81
|
-
{{? $removeAdditional == 'all' }}
|
|
82
|
-
delete {{=$data}}[{{=$key}}];
|
|
83
|
-
{{??}}
|
|
84
|
-
{{
|
|
85
|
-
var $currentErrorPath = it.errorPath;
|
|
86
|
-
var $additionalProperty = '\' + ' + $key + ' + \'';
|
|
87
|
-
if (it.opts._errorDataPathProperty) {
|
|
88
|
-
it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
|
|
89
|
-
}
|
|
90
|
-
}}
|
|
91
|
-
{{? $noAdditional }}
|
|
92
|
-
{{? $removeAdditional }}
|
|
93
|
-
delete {{=$data}}[{{=$key}}];
|
|
94
|
-
{{??}}
|
|
95
|
-
{{=$nextValid}} = false;
|
|
96
|
-
{{
|
|
97
|
-
var $currErrSchemaPath = $errSchemaPath;
|
|
98
|
-
$errSchemaPath = it.errSchemaPath + '/additionalProperties';
|
|
99
|
-
}}
|
|
100
|
-
{{# def.error:'additionalProperties' }}
|
|
101
|
-
{{ $errSchemaPath = $currErrSchemaPath; }}
|
|
102
|
-
{{? $breakOnError }} break; {{?}}
|
|
103
|
-
{{?}}
|
|
104
|
-
{{?? $additionalIsSchema }}
|
|
105
|
-
{{? $removeAdditional == 'failing' }}
|
|
106
|
-
var {{=$errs}} = errors;
|
|
107
|
-
{{# def.setCompositeRule }}
|
|
108
|
-
|
|
109
|
-
{{# def.validateAdditional }}
|
|
110
|
-
|
|
111
|
-
if (!{{=$nextValid}}) {
|
|
112
|
-
errors = {{=$errs}};
|
|
113
|
-
if (validate.errors !== null) {
|
|
114
|
-
if (errors) validate.errors.length = errors;
|
|
115
|
-
else validate.errors = null;
|
|
116
|
-
}
|
|
117
|
-
delete {{=$data}}[{{=$key}}];
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
{{# def.resetCompositeRule }}
|
|
121
|
-
{{??}}
|
|
122
|
-
{{# def.validateAdditional }}
|
|
123
|
-
{{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
|
|
124
|
-
{{?}}
|
|
125
|
-
{{?}}
|
|
126
|
-
{{ it.errorPath = $currentErrorPath; }}
|
|
127
|
-
{{?}}
|
|
128
|
-
{{? $someProperties }}
|
|
129
|
-
}
|
|
130
|
-
{{?}}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
{{# def.ifResultValid }}
|
|
134
|
-
{{?}}
|
|
135
|
-
|
|
136
|
-
{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }}
|
|
137
|
-
|
|
138
|
-
{{? $schemaKeys.length }}
|
|
139
|
-
{{~ $schemaKeys:$propertyKey }}
|
|
140
|
-
{{ var $sch = $schema[$propertyKey]; }}
|
|
141
|
-
|
|
142
|
-
{{? {{# def.nonEmptySchema:$sch}} }}
|
|
143
|
-
{{
|
|
144
|
-
var $prop = it.util.getProperty($propertyKey)
|
|
145
|
-
, $passData = $data + $prop
|
|
146
|
-
, $hasDefault = $useDefaults && $sch.default !== undefined;
|
|
147
|
-
$it.schema = $sch;
|
|
148
|
-
$it.schemaPath = $schemaPath + $prop;
|
|
149
|
-
$it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
|
|
150
|
-
$it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
|
|
151
|
-
$it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
|
|
152
|
-
}}
|
|
153
|
-
|
|
154
|
-
{{# def.generateSubschemaCode }}
|
|
155
|
-
|
|
156
|
-
{{? {{# def.willOptimize }} }}
|
|
157
|
-
{{
|
|
158
|
-
$code = {{# def._optimizeValidate }};
|
|
159
|
-
var $useData = $passData;
|
|
160
|
-
}}
|
|
161
|
-
{{??}}
|
|
162
|
-
{{ var $useData = $nextData; }}
|
|
163
|
-
var {{=$nextData}} = {{=$passData}};
|
|
164
|
-
{{?}}
|
|
165
|
-
|
|
166
|
-
{{? $hasDefault }}
|
|
167
|
-
{{= $code }}
|
|
168
|
-
{{??}}
|
|
169
|
-
{{? $requiredHash && $requiredHash[$propertyKey] }}
|
|
170
|
-
if ({{# def.noPropertyInData }}) {
|
|
171
|
-
{{=$nextValid}} = false;
|
|
172
|
-
{{
|
|
173
|
-
var $currentErrorPath = it.errorPath
|
|
174
|
-
, $currErrSchemaPath = $errSchemaPath
|
|
175
|
-
, $missingProperty = it.util.escapeQuotes($propertyKey);
|
|
176
|
-
if (it.opts._errorDataPathProperty) {
|
|
177
|
-
it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
|
|
178
|
-
}
|
|
179
|
-
$errSchemaPath = it.errSchemaPath + '/required';
|
|
180
|
-
}}
|
|
181
|
-
{{# def.error:'required' }}
|
|
182
|
-
{{ $errSchemaPath = $currErrSchemaPath; }}
|
|
183
|
-
{{ it.errorPath = $currentErrorPath; }}
|
|
184
|
-
} else {
|
|
185
|
-
{{??}}
|
|
186
|
-
{{? $breakOnError }}
|
|
187
|
-
if ({{# def.noPropertyInData }}) {
|
|
188
|
-
{{=$nextValid}} = true;
|
|
189
|
-
} else {
|
|
190
|
-
{{??}}
|
|
191
|
-
if ({{=$useData}} !== undefined
|
|
192
|
-
{{? $ownProperties }}
|
|
193
|
-
&& {{# def.isOwnProperty }}
|
|
194
|
-
{{?}}
|
|
195
|
-
) {
|
|
196
|
-
{{?}}
|
|
197
|
-
{{?}}
|
|
198
|
-
|
|
199
|
-
{{= $code }}
|
|
200
|
-
}
|
|
201
|
-
{{?}} {{ /* $hasDefault */ }}
|
|
202
|
-
{{?}} {{ /* def.nonEmptySchema */ }}
|
|
203
|
-
|
|
204
|
-
{{# def.ifResultValid }}
|
|
205
|
-
{{~}}
|
|
206
|
-
{{?}}
|
|
207
|
-
|
|
208
|
-
{{? $pPropertyKeys.length }}
|
|
209
|
-
{{~ $pPropertyKeys:$pProperty }}
|
|
210
|
-
{{ var $sch = $pProperties[$pProperty]; }}
|
|
211
|
-
|
|
212
|
-
{{? {{# def.nonEmptySchema:$sch}} }}
|
|
213
|
-
{{
|
|
214
|
-
$it.schema = $sch;
|
|
215
|
-
$it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
|
|
216
|
-
$it.errSchemaPath = it.errSchemaPath + '/patternProperties/'
|
|
217
|
-
+ it.util.escapeFragment($pProperty);
|
|
218
|
-
}}
|
|
219
|
-
|
|
220
|
-
{{# def.iterateProperties }}
|
|
221
|
-
if ({{= it.usePattern($pProperty) }}.test({{=$key}})) {
|
|
222
|
-
{{
|
|
223
|
-
$it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
|
|
224
|
-
var $passData = $data + '[' + $key + ']';
|
|
225
|
-
$it.dataPathArr[$dataNxt] = $key;
|
|
226
|
-
}}
|
|
227
|
-
|
|
228
|
-
{{# def.generateSubschemaCode }}
|
|
229
|
-
{{# def.optimizeValidate }}
|
|
230
|
-
|
|
231
|
-
{{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
|
|
232
|
-
}
|
|
233
|
-
{{? $breakOnError }} else {{=$nextValid}} = true; {{?}}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
{{# def.ifResultValid }}
|
|
237
|
-
{{?}} {{ /* def.nonEmptySchema */ }}
|
|
238
|
-
{{~}}
|
|
239
|
-
{{?}}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
{{? $breakOnError }}
|
|
243
|
-
{{= $closingBraces }}
|
|
244
|
-
if ({{=$errs}} == errors) {
|
|
245
|
-
{{?}}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
{{# def.setupNextLevel }}
|
|
5
|
-
|
|
6
|
-
var {{=$errs}} = errors;
|
|
7
|
-
|
|
8
|
-
{{? {{# def.nonEmptySchema:$schema }} }}
|
|
9
|
-
{{
|
|
10
|
-
$it.schema = $schema;
|
|
11
|
-
$it.schemaPath = $schemaPath;
|
|
12
|
-
$it.errSchemaPath = $errSchemaPath;
|
|
13
|
-
}}
|
|
14
|
-
|
|
15
|
-
{{
|
|
16
|
-
var $key = 'key' + $lvl
|
|
17
|
-
, $idx = 'idx' + $lvl
|
|
18
|
-
, $i = 'i' + $lvl
|
|
19
|
-
, $invalidName = '\' + ' + $key + ' + \''
|
|
20
|
-
, $dataNxt = $it.dataLevel = it.dataLevel + 1
|
|
21
|
-
, $nextData = 'data' + $dataNxt
|
|
22
|
-
, $dataProperties = 'dataProperties' + $lvl
|
|
23
|
-
, $ownProperties = it.opts.ownProperties
|
|
24
|
-
, $currentBaseId = it.baseId;
|
|
25
|
-
}}
|
|
26
|
-
|
|
27
|
-
{{? $ownProperties }}
|
|
28
|
-
var {{=$dataProperties}} = undefined;
|
|
29
|
-
{{?}}
|
|
30
|
-
{{# def.iterateProperties }}
|
|
31
|
-
var startErrs{{=$lvl}} = errors;
|
|
32
|
-
|
|
33
|
-
{{ var $passData = $key; }}
|
|
34
|
-
{{# def.setCompositeRule }}
|
|
35
|
-
{{# def.generateSubschemaCode }}
|
|
36
|
-
{{# def.optimizeValidate }}
|
|
37
|
-
{{# def.resetCompositeRule }}
|
|
38
|
-
|
|
39
|
-
if (!{{=$nextValid}}) {
|
|
40
|
-
for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}<errors; {{=$i}}++) {
|
|
41
|
-
vErrors[{{=$i}}].propertyName = {{=$key}};
|
|
42
|
-
}
|
|
43
|
-
{{# def.extraError:'propertyNames' }}
|
|
44
|
-
{{? $breakOnError }} break; {{?}}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
{{?}}
|
|
48
|
-
|
|
49
|
-
{{? $breakOnError }}
|
|
50
|
-
{{= $closingBraces }}
|
|
51
|
-
if ({{=$errs}} == errors) {
|
|
52
|
-
{{?}}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{{# def.definitions }}
|
|
2
|
-
{{# def.errors }}
|
|
3
|
-
{{# def.setupKeyword }}
|
|
4
|
-
|
|
5
|
-
{{## def._validateRef:_v:
|
|
6
|
-
{{? it.opts.passContext }}
|
|
7
|
-
{{=_v}}.call(this,
|
|
8
|
-
{{??}}
|
|
9
|
-
{{=_v}}(
|
|
10
|
-
{{?}}
|
|
11
|
-
{{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData)
|
|
12
|
-
#}}
|
|
13
|
-
|
|
14
|
-
{{ var $async, $refCode; }}
|
|
15
|
-
{{? $schema == '#' || $schema == '#/' }}
|
|
16
|
-
{{
|
|
17
|
-
if (it.isRoot) {
|
|
18
|
-
$async = it.async;
|
|
19
|
-
$refCode = 'validate';
|
|
20
|
-
} else {
|
|
21
|
-
$async = it.root.schema.$async === true;
|
|
22
|
-
$refCode = 'root.refVal[0]';
|
|
23
|
-
}
|
|
24
|
-
}}
|
|
25
|
-
{{??}}
|
|
26
|
-
{{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }}
|
|
27
|
-
{{? $refVal === undefined }}
|
|
28
|
-
{{ var $message = it.MissingRefError.message(it.baseId, $schema); }}
|
|
29
|
-
{{? it.opts.missingRefs == 'fail' }}
|
|
30
|
-
{{ it.logger.error($message); }}
|
|
31
|
-
{{# def.error:'$ref' }}
|
|
32
|
-
{{? $breakOnError }} if (false) { {{?}}
|
|
33
|
-
{{?? it.opts.missingRefs == 'ignore' }}
|
|
34
|
-
{{ it.logger.warn($message); }}
|
|
35
|
-
{{? $breakOnError }} if (true) { {{?}}
|
|
36
|
-
{{??}}
|
|
37
|
-
{{ throw new it.MissingRefError(it.baseId, $schema, $message); }}
|
|
38
|
-
{{?}}
|
|
39
|
-
{{?? $refVal.inline }}
|
|
40
|
-
{{# def.setupNextLevel }}
|
|
41
|
-
{{
|
|
42
|
-
$it.schema = $refVal.schema;
|
|
43
|
-
$it.schemaPath = '';
|
|
44
|
-
$it.errSchemaPath = $schema;
|
|
45
|
-
}}
|
|
46
|
-
{{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }}
|
|
47
|
-
{{= $code }}
|
|
48
|
-
{{? $breakOnError}}
|
|
49
|
-
if ({{=$nextValid}}) {
|
|
50
|
-
{{?}}
|
|
51
|
-
{{??}}
|
|
52
|
-
{{
|
|
53
|
-
$async = $refVal.$async === true || (it.async && $refVal.$async !== false);
|
|
54
|
-
$refCode = $refVal.code;
|
|
55
|
-
}}
|
|
56
|
-
{{?}}
|
|
57
|
-
{{?}}
|
|
58
|
-
|
|
59
|
-
{{? $refCode }}
|
|
60
|
-
{{# def.beginDefOut}}
|
|
61
|
-
{{# def._validateRef:$refCode }}
|
|
62
|
-
{{# def.storeDefOut:__callValidate }}
|
|
63
|
-
|
|
64
|
-
{{? $async }}
|
|
65
|
-
{{ if (!it.async) throw new Error('async schema referenced by sync schema'); }}
|
|
66
|
-
{{? $breakOnError }} var {{=$valid}}; {{?}}
|
|
67
|
-
try {
|
|
68
|
-
await {{=__callValidate}};
|
|
69
|
-
{{? $breakOnError }} {{=$valid}} = true; {{?}}
|
|
70
|
-
} catch (e) {
|
|
71
|
-
if (!(e instanceof ValidationError)) throw e;
|
|
72
|
-
if (vErrors === null) vErrors = e.errors;
|
|
73
|
-
else vErrors = vErrors.concat(e.errors);
|
|
74
|
-
errors = vErrors.length;
|
|
75
|
-
{{? $breakOnError }} {{=$valid}} = false; {{?}}
|
|
76
|
-
}
|
|
77
|
-
{{? $breakOnError }} if ({{=$valid}}) { {{?}}
|
|
78
|
-
{{??}}
|
|
79
|
-
if (!{{=__callValidate}}) {
|
|
80
|
-
if (vErrors === null) vErrors = {{=$refCode}}.errors;
|
|
81
|
-
else vErrors = vErrors.concat({{=$refCode}}.errors);
|
|
82
|
-
errors = vErrors.length;
|
|
83
|
-
} {{? $breakOnError }} else { {{?}}
|
|
84
|
-
{{?}}
|
|
85
|
-
{{?}}
|