This commit is contained in:
DirkSchlossmacher 2023-11-10 15:16:45 +01:00
parent f26f5e5bb4
commit 7a7d82a8a6

View File

@ -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);
}