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.
19 lines
442 B
19 lines
442 B
var isObj = require('./isObj'); |
|
var isFn = require('./isFn'); |
|
var isArr = require('./isArr'); |
|
var mapObj = require('./mapObj'); |
|
exports = function(obj) { |
|
if (isArr(obj)) { |
|
return obj.map(function(val) { |
|
return exports(val); |
|
}); |
|
} |
|
if (isObj(obj) && !isFn(obj)) { |
|
return mapObj(obj, function(val) { |
|
return exports(val); |
|
}); |
|
} |
|
return obj; |
|
}; |
|
|
|
module.exports = exports;
|
|
|