Skip to content

Commit 4fa8811

Browse files
committedMay 30, 2020
fix: use falsey check from arguments;
- 225B
1 parent f43dd23 commit 4fa8811

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎src/index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function toVal(mix) {
44
if (typeof mix === 'object') {
55
if (Array.isArray(mix)) {
66
for (k=0; k < mix.length; k++) {
7-
if (mix[k] && (y = toVal(mix[k]))) {
7+
if (y = toVal(mix[k])) {
88
str && (str += ' ');
99
str += y;
1010
}
@@ -25,11 +25,13 @@ function toVal(mix) {
2525
}
2626

2727
export default function () {
28-
var i=0, x, str='';
28+
var i=0, tmp, x, str='';
2929
while (i < arguments.length) {
30-
if (x = toVal(arguments[i++])) {
31-
str && (str += ' ');
32-
str += x
30+
if (tmp = arguments[i++]) {
31+
if (x = toVal(tmp)) {
32+
str && (str += ' ');
33+
str += x
34+
}
3335
}
3436
}
3537
return str;

0 commit comments

Comments
 (0)
Please sign in to comment.