Travis build: 2067 [cron]

This commit is contained in:
30secondsofcode
2018-05-15 21:09:48 +00:00
parent c51ec370c3
commit 8245fb2fdb
3 changed files with 21 additions and 21 deletions

View File

@ -3,6 +3,6 @@ let clone = Object.assign({}, obj);
Object.keys(clone).forEach(
key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
);
return Array.isArray(obj) ? Array.from(clone) : clone;
return Array.isArray(obj) ? (clone.length = obj.length) && Array.from(clone) : clone;
};
module.exports = deepClone;