mirror of
https://github.com/thangisme/notes.git
synced 2024-11-01 02:37:25 -04:00
29 lines
677 B
Plaintext
29 lines
677 B
Plaintext
{{# def.definitions }}
|
|
{{# def.errors }}
|
|
{{# def.setupKeyword }}
|
|
|
|
{{
|
|
var $key = 'key' + $lvl
|
|
, $matched = 'patternMatched' + $lvl
|
|
, $closingBraces = ''
|
|
, $ownProperties = it.opts.ownProperties;
|
|
}}
|
|
|
|
var {{=$valid}} = true;
|
|
{{~ $schema:$pProperty }}
|
|
var {{=$matched}} = false;
|
|
for (var {{=$key}} in {{=$data}}) {
|
|
{{# def.checkOwnProperty }}
|
|
{{=$matched}} = {{= it.usePattern($pProperty) }}.test({{=$key}});
|
|
if ({{=$matched}}) break;
|
|
}
|
|
|
|
{{ var $missingPattern = it.util.escapeQuotes($pProperty); }}
|
|
if (!{{=$matched}}) {
|
|
{{=$valid}} = false;
|
|
{{# def.addError:'patternRequired' }}
|
|
} {{# def.elseIfValid }}
|
|
{{~}}
|
|
|
|
{{= $closingBraces }}
|