fix: cloning dates in clone util
This commit is contained in:
parent
98b5c0935d
commit
edf1fc6340
@ -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])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user