feat: add multi-model support

This commit is contained in:
Yidadaa
2023-09-26 00:19:21 +08:00
parent b90dfb48ee
commit 5610f423d0
62 changed files with 1439 additions and 940 deletions

17
app/utils/object.ts Normal file
View File

@@ -0,0 +1,17 @@
export function pick<T extends object, U extends (keyof T)[]>(
obj: T,
...keys: U
): Pick<T, U[number]> {
const ret: any = {};
keys.forEach((key) => (ret[key] = obj[key]));
return ret;
}
export function omit<T extends object, U extends (keyof T)[]>(
obj: T,
...keys: U
): Omit<T, U[number]> {
const ret: any = { ...obj };
keys.forEach((key) => delete ret[key]);
return ret;
}