Documents for @litert/utils-array
    Preparing search index...

    Function toDict

    • Transform an object array to a map/dictionary.

      Type Parameters

      • T extends IObject

      Parameters

      • input: readonly T[]

        The array to be transformed

      • key: keyof T | ((v: T) => string | number | symbol)

        The key maker function or the property name of the object.

      Returns IDict<T>

      A dictionary where each key is generated from the input array items.