vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Function mapBy

    • Creates a Map of an iterable object mapping each item to the specified key. The key can be a property name or a function. If the key is not unique the last item will be used that matches the key.

      Type Parameters

      • T
      • K extends string | number
      • I = T

      Parameters

      • iterable: Iterable<T>

        iterable items to map

      • keySelector: keyof T | ((item: T, index: number) => undefined | K)

        function to get the map by key

      • OptionalitemSelector: (item: T, index: number) => I

        function to get the the item value; defaults to the items being iterated

      Returns Map<K, I>