Skip to content

Commit 2205455

Browse files
m.volkovm.volkov
authored andcommitted
Merge branch 'ValYouW-fix-5'.
2 parents dbdc337 + ae196c9 commit 2205455

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ValidatorForm.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class ValidatorForm extends React.Component {
3535
let name = validator;
3636
if (name !== 'required' || includeRequired) {
3737
let extra;
38-
if (validator.indexOf(':') !== -1) {
39-
validator = validator.split(':');
40-
name = validator[0];
41-
extra = validator[1];
38+
const splitIdx = validator.indexOf(':');
39+
if (splitIdx !== -1) {
40+
name = validator.substring(0, splitIdx);
41+
extra = validator.substring(splitIdx + 1);
4242
}
4343
result = Rules[name](value, extra);
4444
}

0 commit comments

Comments
 (0)