rsuite-schema
Advanced tools
Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4
@@ -29,3 +29,3 @@ 'use strict'; | ||
if (!this.required && (typeof value === 'undefined' || value.length === 0)) { | ||
if (!this.required && (typeof value === 'undefined' || value === null || value === '')) { | ||
return { hasError: false }; | ||
@@ -50,4 +50,10 @@ } | ||
this.required = true; | ||
this.addValidator(function (v) { | ||
return typeof v !== 'undefined' && v.length > 0; | ||
this.addValidator(function (value) { | ||
//String & Array | ||
if (value && value.length && value.length > 0) { | ||
return true; | ||
} | ||
return typeof value !== 'undefined' && value !== null; | ||
}, errorMessage); | ||
@@ -54,0 +60,0 @@ return this; |
{ | ||
"name": "rsuite-schema", | ||
"version": "0.0.1-alpha.3", | ||
"version": "0.0.1-alpha.4", | ||
"description": "Schema for data modeling & validation", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
38859
699
0