aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ajv/lib/dot/oneOf.jst
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ajv/lib/dot/oneOf.jst')
-rw-r--r--node_modules/ajv/lib/dot/oneOf.jst24
1 files changed, 17 insertions, 7 deletions
diff --git a/node_modules/ajv/lib/dot/oneOf.jst b/node_modules/ajv/lib/dot/oneOf.jst
index 59a435549..bcce2c6ed 100644
--- a/node_modules/ajv/lib/dot/oneOf.jst
+++ b/node_modules/ajv/lib/dot/oneOf.jst
@@ -3,11 +3,17 @@
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
-var {{=$errs}} = errors;
-var prevValid{{=$lvl}} = false;
-var {{=$valid}} = false;
+{{
+ var $currentBaseId = $it.baseId
+ , $prevValid = 'prevValid' + $lvl
+ , $passingSchemas = 'passingSchemas' + $lvl;
+}}
+
+var {{=$errs}} = errors
+ , {{=$prevValid}} = false
+ , {{=$valid}} = false
+ , {{=$passingSchemas}} = null;
-{{ var $currentBaseId = $it.baseId; }}
{{# def.setCompositeRule }}
{{~ $schema:$sch:$i }}
@@ -24,13 +30,17 @@ var {{=$valid}} = false;
{{?}}
{{? $i }}
- if ({{=$nextValid}} && prevValid{{=$lvl}})
+ if ({{=$nextValid}} && {{=$prevValid}}) {
{{=$valid}} = false;
- else {
+ {{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}];
+ } else {
{{ $closingBraces += '}'; }}
{{?}}
- if ({{=$nextValid}}) {{=$valid}} = prevValid{{=$lvl}} = true;
+ if ({{=$nextValid}}) {
+ {{=$valid}} = {{=$prevValid}} = true;
+ {{=$passingSchemas}} = {{=$i}};
+ }
{{~}}
{{# def.resetCompositeRule }}