uview-plus组件库全面升级更新,订单结算判断支付方式是否可用代码调整,公众号关注二维码修改

This commit is contained in:
2025-10-21 10:44:31 +08:00
parent 5d98b7efc2
commit 5f3a307fec
395 changed files with 31264 additions and 2477 deletions

View File

@@ -0,0 +1,39 @@
// @ts-nocheck
/**
* 深度克隆一个对象或数组
* @param obj 要克隆的对象或数组
* @returns 克隆后的对象或数组
*/
export function cloneDeep<T>(obj : any) : T {
if (obj instanceof Set) {
const set = new Set<any>();
obj.forEach((item : any) => {
set.add(item)
})
return set as T;
}
if (obj instanceof Map) {
const map = new Map<any, any>();
obj.forEach((value : any, key : any) => {
map.set(key, value)
})
return map as T;
}
if (obj instanceof RegExp) {
return new RegExp(obj) as T;
}
if (Array.isArray(obj)) {
return (obj as any[]).map((item : any):any => item) as T;
}
if (obj instanceof Date) {
return new Date(obj.getTime()) as T;
}
if (typeof obj == 'object') {
return UTSJSONObject.assign<T>({}, toRaw(obj))!
}
return obj as T
}