Skip to content

Commit 184bb28

Browse files
authored
Merge pull request #2491 from entrylabs/develop
Master
2 parents 3e8a542 + e0101ce commit 184bb28

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/util/common.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fetch from 'isomorphic-fetch';
22
import _isNaN from 'lodash/isNaN';
33
import _toNumber from 'lodash/toNumber';
4+
import _isNumber from 'lodash/isNumber';
45
import _cuid from 'cuid';
56
import _uid from 'uid';
67

@@ -44,10 +45,10 @@ const Common = {
4445
if (Array.isArray(str)) {
4546
return str.map((x) => Common.toNumber(x));
4647
}
47-
if (typeof str === 'string' && str.trim() === '') {
48-
return str;
48+
if (!_isNaN(parseInt(str, 10))) {
49+
return _toNumber(str);
4950
}
50-
return _toNumber(str) || '';
51+
return str;
5152
},
5253
generateId() {
5354
return _uid(8) + _cuid();

0 commit comments

Comments
 (0)