• Returns either an object containing a subset of properties of the specified source object or the value of a singluar property of the source object.

    Type Parameters

    • Source extends object
    • T extends (keyof Source)[] = (keyof Source)[]

    Parameters

    • source: Source

      the object whose properties should be targeted

    • props: T | (keyof Source)[] | KeyOf<Source>

      a singular property name or an array of property names

    Returns PickFromArray<Source, T> | Source[keyof Source]

    a singular value if props is a string or an object containing a subset of properties if props is an array of strings.