jsonschema
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -115,5 +115,5 @@ 'use strict'; | ||
var FORMAT_REGEXPS = exports.FORMAT_REGEXPS = { | ||
'date-time': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/, | ||
'date': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/, | ||
'time': /^\d{2}:\d{2}:\d{2}$/, | ||
'date-time': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/, | ||
'date': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/, | ||
'time': /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/, | ||
@@ -162,3 +162,3 @@ 'email': /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/, | ||
} | ||
return false; | ||
return true; | ||
}; | ||
@@ -277,2 +277,2 @@ | ||
return a.map(function(v){ return '/'+encodeURIComponent(v).replace(/~/g,'%7E'); }).join(''); | ||
} | ||
}; |
@@ -288,3 +288,4 @@ 'use strict'; | ||
types.number = function testNumber (instance) { | ||
return typeof instance == 'number'; | ||
// isFinite returns false for NaN, Infinity, and -Infinity | ||
return typeof instance == 'number' && isFinite(instance); | ||
}; | ||
@@ -297,5 +298,2 @@ types.integer = function testInteger (instance) { | ||
}; | ||
types.number = function testNumber (instance) { | ||
return typeof instance == 'number'; | ||
}; | ||
types.array = function testArray (instance) { | ||
@@ -302,0 +300,0 @@ return instance instanceof Array; |
{ | ||
"author": "Tom de Grunt <tom@degrunt.nl>", | ||
"name": "jsonschema", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"license": "MIT", | ||
"dependencies": { | ||
@@ -6,0 +7,0 @@ }, |
@@ -81,2 +81,4 @@ [![Build Status](https://secure.travis-ci.org/tdegrunt/jsonschema.svg)](http://travis-ci.org/tdegrunt/jsonschema) | ||
For a comprehensive, annotated example illustrating all possible validation options, see [examples/all.js](./examples/all.js) | ||
## Features | ||
@@ -83,0 +85,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
65968
13
0
1803
182
1