summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/ajv/lib/dot/anyOf.jst
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/ajv/lib/dot/anyOf.jst')
-rw-r--r--deps/npm/node_modules/ajv/lib/dot/anyOf.jst48
1 files changed, 48 insertions, 0 deletions
diff --git a/deps/npm/node_modules/ajv/lib/dot/anyOf.jst b/deps/npm/node_modules/ajv/lib/dot/anyOf.jst
new file mode 100644
index 0000000000..086cf2b33c
--- /dev/null
+++ b/deps/npm/node_modules/ajv/lib/dot/anyOf.jst
@@ -0,0 +1,48 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+{{
+ var $noEmptySchema = $schema.every(function($sch) {
+ return {{# def.nonEmptySchema:$sch }};
+ });
+}}
+{{? $noEmptySchema }}
+ {{ var $currentBaseId = $it.baseId; }}
+ var {{=$errs}} = errors;
+ var {{=$valid}} = false;
+
+ {{# def.setCompositeRule }}
+
+ {{~ $schema:$sch:$i }}
+ {{
+ $it.schema = $sch;
+ $it.schemaPath = $schemaPath + '[' + $i + ']';
+ $it.errSchemaPath = $errSchemaPath + '/' + $i;
+ }}
+
+ {{# def.insertSubschemaCode }}
+
+ {{=$valid}} = {{=$valid}} || {{=$nextValid}};
+
+ if (!{{=$valid}}) {
+ {{ $closingBraces += '}'; }}
+ {{~}}
+
+ {{# def.resetCompositeRule }}
+
+ {{= $closingBraces }}
+
+ if (!{{=$valid}}) {
+ {{# def.extraError:'anyOf' }}
+ } else {
+ {{# def.resetErrors }}
+ {{? it.opts.allErrors }} } {{?}}
+
+ {{# def.cleanUp }}
+{{??}}
+ {{? $breakOnError }}
+ if (true) {
+ {{?}}
+{{?}}