summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst')
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst73
1 files changed, 73 insertions, 0 deletions
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst
new file mode 100644
index 0000000000..ff64b0e740
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst
@@ -0,0 +1,73 @@
+{{# def.definitions }}
+{{# def.errors }}
+{{# def.setupKeyword }}
+{{# def.setupNextLevel }}
+
+
+{{## def.validateIf:
+ {{# def.setCompositeRule }}
+ {{ $it.createErrors = false; }}
+ {{# def._validateSwitchRule:if }}
+ {{ $it.createErrors = true; }}
+ {{# def.resetCompositeRule }}
+ {{=$ifPassed}} = {{=$nextValid}};
+#}}
+
+{{## def.validateThen:
+ {{? typeof $sch.then == 'boolean' }}
+ {{? $sch.then === false }}
+ {{# def.error:'switch' }}
+ {{?}}
+ var {{=$nextValid}} = {{= $sch.then }};
+ {{??}}
+ {{# def._validateSwitchRule:then }}
+ {{?}}
+#}}
+
+{{## def._validateSwitchRule:_clause:
+ {{
+ $it.schema = $sch._clause;
+ $it.schemaPath = $schemaPath + '[' + $caseIndex + ']._clause';
+ $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/_clause';
+ }}
+ {{# def.insertSubschemaCode }}
+#}}
+
+{{## def.switchCase:
+ {{? $sch.if && {{# def.nonEmptySchema:$sch.if }} }}
+ var {{=$errs}} = errors;
+ {{# def.validateIf }}
+ if ({{=$ifPassed}}) {
+ {{# def.validateThen }}
+ } else {
+ {{# def.resetErrors }}
+ }
+ {{??}}
+ {{=$ifPassed}} = true;
+ {{# def.validateThen }}
+ {{?}}
+#}}
+
+
+{{
+ var $ifPassed = 'ifPassed' + it.level
+ , $currentBaseId = $it.baseId
+ , $shouldContinue;
+}}
+var {{=$ifPassed}};
+
+{{~ $schema:$sch:$caseIndex }}
+ {{? $caseIndex && !$shouldContinue }}
+ if (!{{=$ifPassed}}) {
+ {{ $closingBraces+= '}'; }}
+ {{?}}
+
+ {{# def.switchCase }}
+ {{ $shouldContinue = $sch.continue }}
+{{~}}
+
+{{= $closingBraces }}
+
+var {{=$valid}} = {{=$nextValid}};
+
+{{# def.cleanUp }}