export type RequiredField = T & { [P in K]-?: T[P]; }; export type OptionalAll = { [P in keyof T]?: T[P]; }; export type Diff = T extends U ? never : T; export type Filter = T extends U ? T : never; /** * It uses to detect the collection in the model, this is a stupid thing, but I don't see anything better * In theory, you need to get all the Types that were sent to the generic ORM, * and filter those that are in this model, if you know how to do this, open the issue */ export type NonPrimitiveKeys = { [K in keyof T]: T[K] extends (string | number | boolean | symbol | null | undefined | Date) ? never : K; }[keyof T]; export type TypeOrArray = T extends any[] ? T[number] : T;