diff --git a/helpers/omit.ts b/helpers/omit.ts index bd44384..52e37b2 100644 --- a/helpers/omit.ts +++ b/helpers/omit.ts @@ -1,10 +1,9 @@ -import type { Except } from "type-fest" - // eslint-disable-next-line import/no-unused-modules -export function omit( +export function omit( subject: Subject, keys: Key[], -): Except { + // hack: using a conditional type preserves union types +): Subject extends any ? Omit : never { const result: any = {} for (const key in subject) { if (!keys.includes(key as unknown as Key)) {