We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbdc337 + ae196c9 commit 2205455Copy full SHA for 2205455
src/ValidatorForm.jsx
@@ -35,10 +35,10 @@ class ValidatorForm extends React.Component {
35
let name = validator;
36
if (name !== 'required' || includeRequired) {
37
let extra;
38
- if (validator.indexOf(':') !== -1) {
39
- validator = validator.split(':');
40
- name = validator[0];
41
- extra = validator[1];
+ const splitIdx = validator.indexOf(':');
+ if (splitIdx !== -1) {
+ name = validator.substring(0, splitIdx);
+ extra = validator.substring(splitIdx + 1);
42
}
43
result = Rules[name](value, extra);
44
0 commit comments