@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function pick

    • Creates a new object with only the specified keys picked from obj.

      Type Parameters

      • T extends object
      • K extends string | number | symbol

      Parameters

      • obj: T

        The source object.

      • keys: readonly K[]

        Array of keys to include.

      Returns Pick<T, K>

      pick({ a: 1, b: 2, c: 3 }, ["a", "c"]) // => { a: 1, c: 3 }