'admin-22.06.07:函数deepClone对null的判断错误'

This commit is contained in:
lyt
2022-06-07 22:32:32 +08:00
parent f1b2623ad3
commit db69523bf0

View File

@ -106,7 +106,7 @@ export function deepClone(obj: any) {
newObj = {};
}
for (let attr in obj) {
if (typeof obj[attr] === 'object') {
if (obj[attr] && typeof obj[attr] === 'object') {
newObj[attr] = deepClone(obj[attr]);
} else {
newObj[attr] = obj[attr];