@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function omit

    • Creates a new object with specified keys omitted.

      创建一个新对象,省略指定的键。

      Type Parameters

      • T extends Record<PropertyKey, any>
      • K extends string | number | symbol = keyof T

      Parameters

      • obj: T

        The source object. 源对象

      • keys: readonly K[]

        The keys to omit. 要省略的键

      Returns Omit<T, K>

      A new object with the specified keys omitted. 省略了指定键的新对象

      omit({ a: 1, b: 2 }, ['a']) // => { b: 2 }