Skip to content

Commit a961014

Browse files
authored
Merge pull request #6 from mikestaub/bugfix
Bugfix
2 parents c2eace2 + 57a5a6a commit a961014

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/validation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function checkRules(rules: ValidationRules = {}, value: mixed) {
1313
const config = rules[rule];
1414
const options = (typeof config !== 'boolean') && config.options;
1515
const errorMessage = (typeof config !== 'boolean') ? config.errorMessage : GENERIC_ERROR_MESSAGE;
16-
const result = validatorFn(value, options);
16+
const result = options ? validatorFn(value, options) : validatorFn(value);
1717
if (!result) errors.push({ errorMessage, value });
1818
return result && acc;
1919
}, true);

tests/proxy-validator.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ const validators = {
99
},
1010
errorMessage: 'Minimum length 6 characters.'
1111
},
12-
isUppercase: true
13-
}
12+
isUppercase: true,
13+
isAlphanumeric: true,
14+
},
1415
};
1516

1617
const sanitizers = {

0 commit comments

Comments
 (0)