export type Omit = Pick>; /** * Type-safe omit function - returns a new object which omits the specified keys. */ export function omit(obj: T, keysToOmit: K[]): Omit { return Object.keys(obj).reduce((output: any, key) => { if (keysToOmit.includes(key as K)) { return output; } return { ...output, [key]: (obj as any)[key] }; }, {} as Omit); }