Class ArrayUtil

Set of utilities for working with Array types.

Methods

  • Add arrayB to arrayA

    Type Parameters

    • T extends any[]

    Parameters

    • arrayA: T
    • arrayB: T

    Returns T

    A native Typescript array.

  • Will map an array to a map w/ the given key as the key of the map with the value being the first item that matches that key

    Note: If you want more than one value for each key mapped, use GroupByKey

    Type Parameters

    • TValue extends object
    • TKey extends string

    Parameters

    • array: readonly TValue[]

      The array to mapify

    • groupKey: TKey

      The key to use

    Returns ReadonlyMap<TValue[TKey], TValue>