diff options
author | Myles Borins <mylesborins@github.com> | 2020-12-08 18:26:25 -0500 |
---|---|---|
committer | Myles Borins <mylesborins@github.com> | 2020-12-10 13:08:42 -0500 |
commit | 76ea9c5a7a5e3ec15eff91c69dd33b632bcc1837 (patch) | |
tree | f88a68406e38932cc5b3eadeb257a2e95c9b3965 /deps/npm/node_modules/har-validator/node_modules/ajv/lib/data.js | |
parent | 637d0850ef5c199d755a7febdde2b3c13c6285b4 (diff) | |
download | node-new-76ea9c5a7a5e3ec15eff91c69dd33b632bcc1837.tar.gz |
deps: upgrade npm to 6.14.9
PR-URL: https://github.com/nodejs/node/pull/36450
Fixes: https://github.com/docs
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/npm/node_modules/har-validator/node_modules/ajv/lib/data.js')
-rw-r--r-- | deps/npm/node_modules/har-validator/node_modules/ajv/lib/data.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/deps/npm/node_modules/har-validator/node_modules/ajv/lib/data.js b/deps/npm/node_modules/har-validator/node_modules/ajv/lib/data.js new file mode 100644 index 0000000000..f11142bec7 --- /dev/null +++ b/deps/npm/node_modules/har-validator/node_modules/ajv/lib/data.js @@ -0,0 +1,49 @@ +'use strict'; + +var KEYWORDS = [ + 'multipleOf', + 'maximum', + 'exclusiveMaximum', + 'minimum', + 'exclusiveMinimum', + 'maxLength', + 'minLength', + 'pattern', + 'additionalItems', + 'maxItems', + 'minItems', + 'uniqueItems', + 'maxProperties', + 'minProperties', + 'required', + 'additionalProperties', + 'enum', + 'format', + 'const' +]; + +module.exports = function (metaSchema, keywordsJsonPointers) { + for (var i=0; i<keywordsJsonPointers.length; i++) { + metaSchema = JSON.parse(JSON.stringify(metaSchema)); + var segments = keywordsJsonPointers[i].split('/'); + var keywords = metaSchema; + var j; + for (j=1; j<segments.length; j++) + keywords = keywords[segments[j]]; + + for (j=0; j<KEYWORDS.length; j++) { + var key = KEYWORDS[j]; + var schema = keywords[key]; + if (schema) { + keywords[key] = { + anyOf: [ + schema, + { $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' } + ] + }; + } + } + } + + return metaSchema; +}; |