wallet-core/node_modules/ajv/lib/dot/missing.def

40 lines
1.2 KiB
Modula-2
Raw Normal View History

2017-05-03 15:35:00 +02:00
{{## def.checkMissingProperty:_properties:
2017-08-14 05:01:11 +02:00
{{~ _properties:$propertyKey:$i }}
2017-05-03 15:35:00 +02:00
{{?$i}} || {{?}}
2017-08-14 05:01:11 +02:00
{{
var $prop = it.util.getProperty($propertyKey)
, $useData = $data + $prop;
}}
( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) )
2017-05-03 15:35:00 +02:00
{{~}}
#}}
{{## def.errorMissingProperty:_error:
{{
var $propertyPath = 'missing' + $lvl
, $missingProperty = '\' + ' + $propertyPath + ' + \'';
if (it.opts._errorDataPathProperty) {
it.errorPath = it.opts.jsonPointers
? it.util.getPathExpr($currentErrorPath, $propertyPath, true)
: $currentErrorPath + ' + ' + $propertyPath;
}
}}
{{# def.error:_error }}
#}}
2017-08-14 05:01:11 +02:00
2017-05-03 15:35:00 +02:00
{{## def.allErrorsMissingProperty:_error:
{{
2017-08-14 05:01:11 +02:00
var $prop = it.util.getProperty($propertyKey)
, $missingProperty = it.util.escapeQuotes($propertyKey)
, $useData = $data + $prop;
2017-05-03 15:35:00 +02:00
if (it.opts._errorDataPathProperty) {
2017-08-14 05:01:11 +02:00
it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
2017-05-03 15:35:00 +02:00
}
}}
2017-08-14 05:01:11 +02:00
if ({{# def.noPropertyInData }}) {
2017-05-03 15:35:00 +02:00
{{# def.addError:_error }}
}
#}}