@yesstudio/yes-utils
    Preparing search index...

    Function pick

    • Picks the properties from the source object specified by the keys array and returns a new object with those properties.

      Type Parameters

      • TSource extends Record<string, unknown>

      Parameters

      • source: TSource

        The source object to pick properties from.

      • ...keys: readonly (keyof TSource)[]

        Spread of keys to pick from the source object.

      Returns Pick<TSource, keyof TSource>

      A new object with the picked properties.

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