diff options
author | Rebecca Turner <me@re-becca.org> | 2017-04-12 21:47:49 -0700 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2017-04-25 10:52:01 -0400 |
commit | 00842604483e4c2e622dfdb3a97440e07646158f (patch) | |
tree | f3346902636a44b6037652523767636bf7e4f2c9 /deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js | |
parent | 061c5da010e0d249379618382a499840d38247b8 (diff) | |
download | android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.tar.gz android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.tar.bz2 android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.zip |
deps: upgrade npm to 4.5.0
PR-URL: https://github.com/nodejs/node/pull/12480
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js')
-rw-r--r-- | deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js new file mode 100644 index 0000000000..39b1708d96 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js @@ -0,0 +1,40 @@ +'use strict'; + +var ruleModules = require('./_rules') + , toHash = require('./util').toHash; + +module.exports = function rules() { + var RULES = [ + { type: 'number', + rules: [ 'maximum', 'minimum', 'multipleOf'] }, + { type: 'string', + rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, + { type: 'array', + rules: [ 'maxItems', 'minItems', 'uniqueItems', 'items' ] }, + { type: 'object', + rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'properties' ] }, + { rules: [ '$ref', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] } + ]; + + var ALL = [ 'type', 'additionalProperties', 'patternProperties' ]; + var KEYWORDS = [ 'additionalItems', '$schema', 'id', 'title', 'description', 'default' ]; + var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; + RULES.all = toHash(ALL); + + RULES.forEach(function (group) { + group.rules = group.rules.map(function (keyword) { + ALL.push(keyword); + var rule = RULES.all[keyword] = { + keyword: keyword, + code: ruleModules[keyword] + }; + return rule; + }); + }); + + RULES.keywords = toHash(ALL.concat(KEYWORDS)); + RULES.types = toHash(TYPES); + RULES.custom = {}; + + return RULES; +}; |