Function pick

  • Picks properties from source value. If source type is nullable or optional, the result type is nullable or optional too.

    There are two signatures of this function, depending on number of properties.

    1. When number of picked properties <= 15, the result type will be the source value only with these properties (strongly typed).
    2. If the number of picked properties > 15, the result will be the source value with all properties marked as optional.

    Returns

    the source value with picked properties

    Type Parameters

    • T

    • K extends string | number | symbol

    Parameters

    • source: T

      source value which properties should be picked

    • keys: K[]

      array of names of the properties

    Returns Pick<T, K>

  • Picks properties from source value. If source type is nullable or optional, the result type is nullable or optional too.

    There are two signatures of this function, depending on number of properties.

    1. When number of picked properties <= 15, the result type will be the source value only with these properties (strongly typed).
    2. If the number of picked properties > 15, the result will be the source value with all properties marked as optional.

    Returns

    the source value with picked properties

    Type Parameters

    • T

    • K extends string | number | symbol

    Parameters

    • source: Nullable<T>

      source value which properties should be picked

    • keys: K[]

      array of names of the properties

    Returns Undefinable<Pick<T, K>>

  • Picks properties from source value. If source type is nullable or optional, the result type is nullable or optional too.

    There are two signatures of this function, depending on number of properties.

    1. When number of picked properties <= 15, the result type will be the source value only with these properties (strongly typed).
    2. If the number of picked properties > 15, the result will be the source value with all properties marked as optional.

    Returns

    the source value with picked properties

    Type Parameters

    • T

    • K extends string | number | symbol

    Parameters

    • source: Nullable<T>

      source value which properties should be picked

    • keys: K[]

      array of names of the properties

    Returns Nullable<Pick<T, K>>

  • Picks properties from source value. If source type is nullable or optional, the result type is nullable or optional too.

    There are two signatures of this function, depending on number of properties.

    1. When number of picked properties <= 15, the result type will be the source value only with these properties (strongly typed).
    2. If the number of picked properties > 15, the result will be the source value with all properties marked as optional.

    Returns

    the source value with picked properties

    Type Parameters

    • T

    • K extends string | number | symbol

    Parameters

    • source: Optional<T>

      source value which properties should be picked

    • keys: K[]

      array of names of the properties

    Returns Optional<Pick<T, K>>

Generated using TypeDoc