Function indexSignatureFromArrayValues

  • Creates an index signature from the given array with every elements mapped using the given valueExtractor.

    Type Parameters

    • T

    • U

    Parameters

    • array: T[]

      The array to convert.

    • idExtractor: ((element) => string)

      A function to extract the id from each array elements.

        • (element): string
        • Parameters

          • element: T

          Returns string

    • valueExtractor: ((element) => U)

      A mapper function to convert each element of the array from T to U.

        • (element): U
        • Parameters

          • element: T

          Returns U

    Returns {
        [id: string]: U;
    }

    the created index signature.

    • [id: string]: U

Generated using TypeDoc