Skip to content

Commit

Permalink
fix: use falsey check from arguments;
Browse files Browse the repository at this point in the history
- 225B
  • Loading branch information
lukeed committed May 30, 2020
1 parent f43dd23 commit 4fa8811
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function toVal(mix) {
if (typeof mix === 'object') {
if (Array.isArray(mix)) {
for (k=0; k < mix.length; k++) {
if (mix[k] && (y = toVal(mix[k]))) {
if (y = toVal(mix[k])) {
str && (str += ' ');
str += y;
}
Expand All @@ -25,11 +25,13 @@ function toVal(mix) {
}

export default function () {
var i=0, x, str='';
var i=0, tmp, x, str='';
while (i < arguments.length) {
if (x = toVal(arguments[i++])) {
str && (str += ' ');
str += x
if (tmp = arguments[i++]) {
if (x = toVal(tmp)) {
str && (str += ' ');
str += x
}
}
}
return str;
Expand Down

0 comments on commit 4fa8811

Please sign in to comment.