mirror of
https://github.com/thangisme/notes.git
synced 2024-11-01 08:17:34 -04:00
49 lines
941 B
Plaintext
49 lines
941 B
Plaintext
|
{{# 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.addError:'anyOf' }}
|
||
|
} else {
|
||
|
{{# def.resetErrors }}
|
||
|
{{? it.opts.allErrors }} } {{?}}
|
||
|
|
||
|
{{# def.cleanUp }}
|
||
|
{{??}}
|
||
|
{{? $breakOnError }}
|
||
|
if (true) {
|
||
|
{{?}}
|
||
|
{{?}}
|