Function pick

  • Creates an object composed of the picked object properties.

    Type Parameters

    • T extends object

    Parameters

    • object: object

      The source object.

    • Optional Rest...paths: PropertyPath[]

      The property paths to pick.

    Returns Partial<T>

    Returns the new object.

    0.1.0

    const object = { 'a': 1, 'b': '2', 'c': 3 }

    pick(object, ['a', 'c'])
    // => { 'a': 1, 'c': 3 }