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>(obj: O) => Or<IsWide<string, K>, IsWide<number, K>> extends true
        ? Partial<O>
        : Omit<O, K>)

      • <O>(obj): Or<IsWide<string, K>, IsWide<number, K>> extends true
            ? Partial<O>
            : Omit<O, K>
      • Type Parameters

        • O extends Record<K, unknown>

        Parameters

        • obj: O

        Returns Or<IsWide<string, K>, IsWide<number, K>> extends true
            ? Partial<O>
            : Omit<O, K>