Comparing version 4.0.1 to 4.0.2
@@ -0,1 +1,5 @@ | ||
### v4.0.2 (2019-06-01): | ||
* Fixed bug in `zip` type that disallowed numeric values. Now values are coerced to strings before validation checks. | ||
### v4.0.1 (2019-05-16): | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "obey", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Data modelling and validation library", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -7,3 +7,4 @@ const zip = { | ||
default: context => { | ||
if (context.value == null || !context.value.length || !context.value.toString().match(zip._regex.default)) { | ||
const stringified = context.value != null && context.value.toString() | ||
if (!stringified || !stringified.length || !stringified.match(zip._regex.default)) { | ||
context.fail('Value must be a valid US zip code') | ||
@@ -13,3 +14,4 @@ } | ||
ca: context => { | ||
if (context.value == null || !context.value.length || !context.value.toString().match(zip._regex.ca)) { | ||
const stringified = context.value != null && context.value.toString() | ||
if (!stringified || !stringified.length || !stringified.match(zip._regex.ca)) { | ||
context.fail('Value must be a valid Canadian zip code') | ||
@@ -16,0 +18,0 @@ } |
Sorry, the diff of this file is not supported yet
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
78113
850