ajv-keywords
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -12,2 +12,3 @@ 'use strict'; | ||
* @param {String|Array<String>|undefined} keyword keyword(s) to define | ||
* @return {Ajv} ajv instance (for chaining) | ||
*/ | ||
@@ -18,9 +19,10 @@ function defineKeywords(ajv, keyword) { | ||
get(keyword[i])(ajv); | ||
return; | ||
return ajv; | ||
} | ||
if (keyword) { | ||
get(keyword)(ajv); | ||
return; | ||
return ajv; | ||
} | ||
for (keyword in KEYWORDS) get(keyword)(ajv); | ||
return ajv; | ||
} | ||
@@ -27,0 +29,0 @@ |
@@ -61,2 +61,3 @@ 'use strict'; | ||
ajv.addKeyword('dynamicDefaults', defFunc.definition); | ||
return ajv; | ||
@@ -63,0 +64,0 @@ function getDefault(d) { |
@@ -10,2 +10,6 @@ 'use strict'; | ||
dynamicDefaults: require('./dynamicDefaults') | ||
// formatMinimum: require('./formatMinimum'), | ||
// formatMaximum: require('./formatMaximum'), | ||
// patternRequired: require('./patternRequired'), | ||
// 'switch': require('./switch') | ||
}; |
@@ -47,2 +47,3 @@ 'use strict'; | ||
ajv.addKeyword('instanceof', defFunc.definition); | ||
return ajv; | ||
@@ -49,0 +50,0 @@ function getConstructor(c) { |
@@ -50,2 +50,3 @@ 'use strict'; | ||
ajv.addKeyword('propertyNames', defFunc.definition); | ||
return ajv; | ||
}; |
@@ -30,2 +30,3 @@ 'use strict'; | ||
ajv.addKeyword('exclusiveRange'); | ||
return ajv; | ||
@@ -32,0 +33,0 @@ function validateRangeSchema(min, max, exclusive) { |
@@ -35,2 +35,3 @@ 'use strict'; | ||
ajv.addKeyword('regexp', defFunc.definition); | ||
return ajv; | ||
}; |
@@ -31,2 +31,3 @@ 'use strict'; | ||
ajv.addKeyword('typeof', defFunc.definition); | ||
return ajv; | ||
}; |
{ | ||
"name": "ajv-keywords", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Custom JSON-Schema keywords for ajv validator", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "npm run eslint && npm run test-cov", | ||
"build": "node node_modules/ajv/scripts/compile-dots.js node_modules/ajv/lib keywords", | ||
"prepublish": "npm run build", | ||
"test": "npm run build && npm run eslint && npm run test-cov", | ||
"eslint": "eslint index.js keywords/*.js", | ||
@@ -21,2 +23,6 @@ "test-spec": "mocha spec/*.spec.js -R spec", | ||
], | ||
"files": [ | ||
"index.js", | ||
"keywords" | ||
], | ||
"author": "Evgeny Poberezkin", | ||
@@ -29,11 +35,15 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"ajv": ">=4.9.0" | ||
"ajv": ">=4.10.0" | ||
}, | ||
"devDependencies": { | ||
"ajv": "^4.9.0", | ||
"ajv": "^4.10.0", | ||
"ajv-pack": "^0.2.0", | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.11.9", | ||
"dot": "^1.1.1", | ||
"eslint": "^3.6.0", | ||
"glob": "^7.1.1", | ||
"istanbul": "^0.4.3", | ||
"js-beautify": "^1.6.4", | ||
"json-schema-test": "^1.2.1", | ||
"mocha": "^3.0.2", | ||
@@ -40,0 +50,0 @@ "pre-commit": "^1.1.3", |
@@ -201,4 +201,4 @@ # ajv-keywords | ||
- `"timestamp"` - current timestamp in milliseconds | ||
- `"datetime"' - current date and time as string (ISO, valid according to `date-time` format) | ||
- `"date"' - current date as string (ISO, valid according to `date` format) | ||
- `"datetime"` - current date and time as string (ISO, valid according to `date-time` format) | ||
- `"date"` - current date as string (ISO, valid according to `date` format) | ||
- `"time"` - current time as string (ISO, valid according to `time` format) | ||
@@ -205,0 +205,0 @@ - `"random"` - pseudo-random number in [0, 1) interval |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44660
23
784
13
1