Skip to content

Commit 08a5a7f

Browse files
committedMay 30, 2020
fix: reorder typeof checks
1 parent 019ec02 commit 08a5a7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
function toVal(mix) {
22
var k, y, str='';
33

4-
if (typeof mix === 'object') {
4+
if (typeof mix === 'string' || typeof mix === 'number') {
5+
str += mix;
6+
} else if (typeof mix === 'object') {
57
if (Array.isArray(mix)) {
68
for (k=0; k < mix.length; k++) {
79
if (mix[k]) {
@@ -19,8 +21,6 @@ function toVal(mix) {
1921
}
2022
}
2123
}
22-
} else if (typeof mix !== 'boolean' && !mix.call) {
23-
str += mix;
2424
}
2525

2626
return str;

0 commit comments

Comments
 (0)
Please sign in to comment.