🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

contracts

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contracts - npm Package Compare versions

Comparing version

to
0.4.0

5

History.md

@@ -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 @@ ==================

2

lib/contracts.js

@@ -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"],