diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/ajv/lib/dot/missing.def | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/ajv/lib/dot/missing.def')
-rw-r--r-- | node_modules/ajv/lib/dot/missing.def | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/node_modules/ajv/lib/dot/missing.def b/node_modules/ajv/lib/dot/missing.def index 23ad04cf4..a73b9f966 100644 --- a/node_modules/ajv/lib/dot/missing.def +++ b/node_modules/ajv/lib/dot/missing.def @@ -1,8 +1,11 @@ {{## def.checkMissingProperty:_properties: - {{~ _properties:_$property:$i }} + {{~ _properties:$propertyKey:$i }} {{?$i}} || {{?}} - {{ var $prop = it.util.getProperty(_$property); }} - ( {{=$data}}{{=$prop}} === undefined && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop) }}) ) + {{ + var $prop = it.util.getProperty($propertyKey) + , $useData = $data + $prop; + }} + ( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) ) {{~}} #}} @@ -20,15 +23,17 @@ {{# def.error:_error }} #}} + {{## def.allErrorsMissingProperty:_error: {{ - var $prop = it.util.getProperty($reqProperty) - , $missingProperty = it.util.escapeQuotes($reqProperty); + var $prop = it.util.getProperty($propertyKey) + , $missingProperty = it.util.escapeQuotes($propertyKey) + , $useData = $data + $prop; if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } }} - if ({{=$data}}{{=$prop}} === undefined) { + if ({{# def.noPropertyInData }}) { {{# def.addError:_error }} } #}} |