Fixed issues with deepClone, built everything
This commit is contained in:
@ -12,7 +12,11 @@ const deepClone = obj => {
|
||||
Object.keys(clone).forEach(
|
||||
key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
|
||||
);
|
||||
return Array.isArray(obj) ? Array.from(obj) : clone;
|
||||
return Array.isArray(obj) && obj.length
|
||||
? (clone.length = obj.length) && Array.from(clone)
|
||||
: Array.isArray(obj)
|
||||
? Array.from(obj)
|
||||
: clone;
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user