BUPKIS
    Preparing search index...

    Function keyBy

    • Maps an array of objects to an object keyed by the specified key.

      Type Parameters

      • const T extends readonly Record<PropertyKey, any>[]
      • K extends string

      Parameters

      • collection: T

        Array of objects

      • key: K

        Name of key

      Returns Record<string, T[number]>

      Object mapping key values to objects