Skip to content

Commit 6d08c4a

Browse files
authored
Merge pull request #154 from lkho/patch-2
fix double validator
2 parents a832b46 + 7c6d658 commit 6d08c4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/validators.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ module.exports = {
8585
double(value, field) {
8686
let res = checkEmpty(value, field.required); if (res != null) return res;
8787

88-
if (!(Number(value) === value && value % 1 !== 0))
88+
if (!isNumber(value) || isNaN(value))
8989
return [msg(resources.invalidNumber)];
9090
},
9191

@@ -227,4 +227,4 @@ module.exports = {
227227
if (!re.test(value))
228228
return [msg(resources.invalidTextContainSpec)];
229229
}
230-
};
230+
};

0 commit comments

Comments
 (0)