mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
12 lines
244 B
JavaScript
12 lines
244 B
JavaScript
import deepAssign from './deep-assign';
|
|
|
|
export default function deepClone(obj) {
|
|
if (Array.isArray(obj)) {
|
|
return obj.map(item => deepClone(item));
|
|
}
|
|
if (typeof obj === 'object') {
|
|
return deepAssign({}, obj);
|
|
}
|
|
return obj;
|
|
}
|