Merge pull request #7192 from FreeCodeCamp/greenkeeper-validator-5.0.0
Update validator to version 5.0.0 🚀
This commit is contained in:
@@ -61,15 +61,15 @@ const checkboxClass = dedent`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
function formatValue(value, validator, type = 'string') {
|
function formatValue(value, validator, type = 'string') {
|
||||||
const formated = getDefaults(type);
|
const formatted = getDefaults(type);
|
||||||
if (validator && type === 'string') {
|
if (validator && type === 'string' && typeof value === 'string') {
|
||||||
formated.valid = validator(value);
|
formatted.valid = validator(value);
|
||||||
}
|
}
|
||||||
if (value) {
|
if (value) {
|
||||||
formated.value = value;
|
formatted.value = value;
|
||||||
formated.bsStyle = formated.valid ? 'success' : 'error';
|
formatted.bsStyle = formatted.valid ? 'success' : 'error';
|
||||||
}
|
}
|
||||||
return formated;
|
return formatted;
|
||||||
}
|
}
|
||||||
|
|
||||||
const normalizeOptions = {
|
const normalizeOptions = {
|
||||||
|
@@ -119,7 +119,7 @@
|
|||||||
"thundercats": "^3.1.0",
|
"thundercats": "^3.1.0",
|
||||||
"thundercats-react": "~0.5.1",
|
"thundercats-react": "~0.5.1",
|
||||||
"url-regex": "^3.0.0",
|
"url-regex": "^3.0.0",
|
||||||
"validator": "^4.2.1",
|
"validator": "^5.0.0",
|
||||||
"webpack": "^1.9.12",
|
"webpack": "^1.9.12",
|
||||||
"webpack-stream": "^3.1.0",
|
"webpack-stream": "^3.1.0",
|
||||||
"xss-filters": "^1.2.6",
|
"xss-filters": "^1.2.6",
|
||||||
|
Reference in New Issue
Block a user