We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
toVal
1 parent 4fa8811 commit 019ec02Copy full SHA for 019ec02
src/index.js
@@ -1,26 +1,28 @@
1
function toVal(mix) {
2
var k, y, str='';
3
- if (mix) {
4
- if (typeof mix === 'object') {
5
- if (Array.isArray(mix)) {
6
- for (k=0; k < mix.length; k++) {
+
+ if (typeof mix === 'object') {
+ if (Array.isArray(mix)) {
+ for (k=0; k < mix.length; k++) {
7
+ if (mix[k]) {
8
if (y = toVal(mix[k])) {
9
str && (str += ' ');
10
str += y;
11
}
12
- } else {
13
- for (k in mix) {
14
- if (mix[k]) {
15
- str && (str += ' ');
16
- str += k;
17
- }
+ }
+ } else {
+ for (k in mix) {
+ str && (str += ' ');
18
+ str += k;
19
20
- } else if (typeof mix !== 'boolean' && !mix.call) {
21
- str += mix;
22
+ } else if (typeof mix !== 'boolean' && !mix.call) {
23
+ str += mix;
24
25
26
return str;
27
28
0 commit comments