diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/ajv/lib/dot/properties.jst | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/ajv/lib/dot/properties.jst')
-rw-r--r-- | node_modules/ajv/lib/dot/properties.jst | 89 |
1 files changed, 3 insertions, 86 deletions
diff --git a/node_modules/ajv/lib/dot/properties.jst b/node_modules/ajv/lib/dot/properties.jst index 8d56324b7..862067e75 100644 --- a/node_modules/ajv/lib/dot/properties.jst +++ b/node_modules/ajv/lib/dot/properties.jst @@ -42,13 +42,8 @@ , $currentBaseId = it.baseId; var $required = it.schema.required; - if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) + if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); - - if (it.opts.patternGroups) { - var $pgProperties = it.schema.patternGroups || {} - , $pgPropertyKeys = Object.keys($pgProperties); - } }} @@ -63,8 +58,8 @@ var {{=$nextValid}} = true; {{? $someProperties }} var isAdditional{{=$lvl}} = !(false {{? $schemaKeys.length }} - {{? $schemaKeys.length > 5 }} - || validate.schema{{=$schemaPath}}[{{=$key}}] + {{? $schemaKeys.length > 8 }} + || validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}}) {{??}} {{~ $schemaKeys:$propertyKey }} || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} @@ -76,11 +71,6 @@ var {{=$nextValid}} = true; || {{= it.usePattern($pProperty) }}.test({{=$key}}) {{~}} {{?}} - {{? it.opts.patternGroups && $pgPropertyKeys.length }} - {{~ $pgPropertyKeys:$pgProperty:$i }} - || {{= it.usePattern($pgProperty) }}.test({{=$key}}) - {{~}} - {{?}} ); if (isAdditional{{=$lvl}}) { @@ -246,79 +236,6 @@ var {{=$nextValid}} = true; {{?}} -{{? it.opts.patternGroups && $pgPropertyKeys.length }} - {{~ $pgPropertyKeys:$pgProperty }} - {{ - var $pgSchema = $pgProperties[$pgProperty] - , $sch = $pgSchema.schema; - }} - - {{? {{# def.nonEmptySchema:$sch}} }} - {{ - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; - $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' - + it.util.escapeFragment($pgProperty) - + '/schema'; - }} - - var pgPropCount{{=$lvl}} = 0; - - {{# def.iterateProperties }} - if ({{= it.usePattern($pgProperty) }}.test({{=$key}})) { - pgPropCount{{=$lvl}}++; - - {{ - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - }} - - {{# def.generateSubschemaCode }} - {{# def.optimizeValidate }} - - {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} - } - {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} - } - - {{# def.ifResultValid }} - - {{ - var $pgMin = $pgSchema.minimum - , $pgMax = $pgSchema.maximum; - }} - {{? $pgMin !== undefined || $pgMax !== undefined }} - var {{=$valid}} = true; - - {{ var $currErrSchemaPath = $errSchemaPath; }} - - {{? $pgMin !== undefined }} - {{ var $limit = $pgMin, $reason = 'minimum', $moreOrLess = 'less'; }} - {{=$valid}} = pgPropCount{{=$lvl}} >= {{=$pgMin}}; - {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; }} - {{# def.checkError:'patternGroups' }} - {{? $pgMax !== undefined }} - else - {{?}} - {{?}} - - {{? $pgMax !== undefined }} - {{ var $limit = $pgMax, $reason = 'maximum', $moreOrLess = 'more'; }} - {{=$valid}} = pgPropCount{{=$lvl}} <= {{=$pgMax}}; - {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; }} - {{# def.checkError:'patternGroups' }} - {{?}} - - {{ $errSchemaPath = $currErrSchemaPath; }} - - {{# def.ifValid }} - {{?}} - {{?}} {{ /* def.nonEmptySchema */ }} - {{~}} -{{?}} - - {{? $breakOnError }} {{= $closingBraces }} if ({{=$errs}} == errors) { |