mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 03:26:38 +08:00
clone.ts
This commit is contained in:
parent
f26f5e5bb4
commit
7a7d82a8a6
@ -1,10 +1,3 @@
|
||||
export function deepClone<T>(obj: T) {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
export function ensure<T extends object>(
|
||||
obj: T,
|
||||
keys: Array<[keyof T][number]>,
|
||||
) {
|
||||
return keys.every((k) => obj[k] !== undefined && obj[k] !== null);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user