Skip to content

Commit

Permalink
fix: reorder typeof checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed May 30, 2020
1 parent 019ec02 commit 08a5a7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
function toVal(mix) {
var k, y, str='';

if (typeof mix === 'object') {
if (typeof mix === 'string' || typeof mix === 'number') {
str += mix;
} else if (typeof mix === 'object') {
if (Array.isArray(mix)) {
for (k=0; k < mix.length; k++) {
if (mix[k]) {
Expand All @@ -19,8 +21,6 @@ function toVal(mix) {
}
}
}
} else if (typeof mix !== 'boolean' && !mix.call) {
str += mix;
}

return str;
Expand Down

0 comments on commit 08a5a7f

Please sign in to comment.