1
0
mirror of synced 2024-11-22 05:16:05 +03:00

fix: cloning dates in clone util

This commit is contained in:
Zaytsev Kirill 2020-10-28 22:45:11 +03:00
parent 98b5c0935d
commit edf1fc6340

View File

@ -14,7 +14,13 @@ export default function clone (value: any): any {
for (const key in value) {
if (has(value, key)) {
copy[key] = isScalar(value[key]) ? value[key] : clone(value[key])
if (isScalar(value[key])) {
copy[key] = value[key]
} else if (value instanceof Date) {
copy[key] = new Date(copy[key])
} else {
copy[key] = clone(value[key])
}
}
}