Comparing version
@@ -0,1 +1,6 @@ | ||
0.4.0 / 2012-03-10 | ||
================== | ||
* Expose format validators just as they can be reused | ||
0.3.2 / 2012-03-01 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -11,3 +11,3 @@ /*! | ||
exports.version = '0.3.2'; | ||
exports.version = '0.4.0'; | ||
@@ -14,0 +14,0 @@ /** |
@@ -16,4 +16,5 @@ | ||
for (var key in formats) { | ||
formatValidators[key] = (function(formatValidator) { | ||
return function(instance, report) { | ||
(function(formatValidator) { | ||
formatValidators[key] = formatValidator; | ||
formatValidators.jsvValidators[key] = function(instance, report) { | ||
return formatValidator(instance.getValue()); | ||
@@ -26,2 +27,7 @@ }; | ||
/** | ||
* Store jsv-compatible versions of the validators in this object. | ||
*/ | ||
formatValidators.jsvValidators = {}; | ||
/** | ||
* Patch node-validator's validators for our API. | ||
@@ -28,0 +34,0 @@ */ |
@@ -68,3 +68,3 @@ /*! | ||
*/ | ||
schemaSchemaJson.properties.format.formatValidators = require('./formats'); | ||
schemaSchemaJson.properties.format.formatValidators = require('./formats').jsvValidators; | ||
@@ -71,0 +71,0 @@ schemaSchema = environment.createSchema(schemaSchemaJson, true, "http://contracts.nilsson.is/schema#"); |
{ | ||
"name" : "contracts", | ||
"version" : "0.3.2", | ||
"version" : "0.4.0", | ||
"description" : "Validation library to define and validate JSON Schemas for functions and express handlers. Supports filters.", | ||
@@ -5,0 +5,0 @@ "keywords" : ["json schema", "schema", "data", "validation", "express"], |
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
15718
1.79%326
1.56%0
-100%