jsonpolice
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -136,3 +136,3 @@ "use strict"; | ||
case 'string': | ||
found = typeof data === 'string'; | ||
found = typeof data === 'string' || data instanceof Date; | ||
break; | ||
@@ -244,2 +244,4 @@ default: | ||
patternValidator(data, spec, path, opts) { | ||
if (data instanceof Date) | ||
data = data.toISOString(); | ||
if (typeof data === 'string') { | ||
@@ -256,2 +258,8 @@ if (typeof spec.pattern !== 'string') { | ||
formatValidator(data, spec, path, opts) { | ||
if (data instanceof Date) { | ||
data = data.toISOString(); | ||
if (spec.format === 'date') { | ||
data = data.substring(0, 10); | ||
} | ||
} | ||
if (typeof data === 'string') { | ||
@@ -258,0 +266,0 @@ if (typeof spec.format !== 'string') { |
{ | ||
"name": "jsonpolice", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"description": "JSON Schema parser and validator", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
44158
879