Function omit

Returns a new object with the specified keys omitted.

const obj = { a: 1, b: '2', c: true };
const result = omit(['a', 'c'])(obj);
// result: { b: '2' }
  • Type Parameters

    • K extends string | number

    Parameters

    • keys: K[]

    Returns <O extends Record<K, unknown>>(
        obj: O,
    ) => Or<IsWide<string, K>, IsWide<number, K>> extends true
        ? Partial<O>
        : Omit<O, K>