You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
572 B
20 lines
572 B
var each = require('./each'); |
|
var isStr = require('./isStr'); |
|
var isNum = require('./isNum'); |
|
var isArr = require('./isArr'); |
|
var isObj = require('./isObj'); |
|
exports = function() { |
|
var ret = []; |
|
each(arguments, function(arg) { |
|
if (!arg) return; |
|
if (isStr(arg) || isNum(arg)) return ret.push(arg); |
|
if (isArr(arg)) return ret.push(exports.apply(null, arg)); |
|
if (!isObj(arg)) return; |
|
each(arg, function(val, key) { |
|
if (val) ret.push(key); |
|
}); |
|
}); |
|
return ret.join(' '); |
|
}; |
|
|
|
module.exports = exports;
|
|
|