export function omitBy( obj: T, predicate: (value: T[keyof T], key: string) => unknown ): Partial export function omitBy( obj: Record, predicate: (value: T, key: string) => unknown = () => true ): Record { if (!obj) { return {} } return Object.fromEntries( Object.entries(obj).filter( ([key, value]) => !Boolean(predicate(value, key)) ) ) }