Fix issue #1009
This commit is contained in:
committed by
Angelos Chalaris
parent
a26783ea6c
commit
6c00c38a61
@ -20,6 +20,9 @@ const deepClone = obj => {
|
|||||||
Object.keys(clone).forEach(
|
Object.keys(clone).forEach(
|
||||||
key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
|
key => (clone[key] = typeof obj[key] === 'object' ? deepClone(obj[key]) : obj[key])
|
||||||
);
|
);
|
||||||
|
if (obj) {
|
||||||
|
Object.setPrototypeOf(clone, Object.getPrototypeOf(obj));
|
||||||
|
}
|
||||||
return Array.isArray(obj) && obj.length
|
return Array.isArray(obj) && obj.length
|
||||||
? (clone.length = obj.length) && Array.from(clone)
|
? (clone.length = obj.length) && Array.from(clone)
|
||||||
: Array.isArray(obj)
|
: Array.isArray(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user