@expandorg/validation
Advanced tools
Comparing version 0.2.5 to 0.2.6
{ | ||
"name": "@expandorg/validation", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "Expand UI validation library", | ||
@@ -17,5 +17,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"validator": "^10.9.0" | ||
"validator": "^11.1.0" | ||
}, | ||
"gitHead": "14a9fc49f391eebb06f22532147de5abda332ff9" | ||
"gitHead": "7acda91bb9dfad9c96a362edeb0d0122e0319b3c" | ||
} |
// @flow | ||
const validateField = (fieldValue: any, fieldRules: Array<any> | Object) => { | ||
const failedRule = fieldRules.find(rule => { | ||
const [fn, ...args] = rule; | ||
const failed = fieldRules.find(rule => { | ||
// eslint-disable-next-line no-unused-vars | ||
const [fn, message, ...args] = rule; | ||
return !fn(fieldValue, ...args); | ||
}); | ||
return failedRule ? failedRule[1] : null; | ||
return failed ? failed[1] : null; | ||
}; | ||
export default validateField; |
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
19862
84
+ Addedvalidator@11.1.0(transitive)
- Removedvalidator@10.11.0(transitive)
Updatedvalidator@^11.1.0