ixfx
    Preparing search index...

    Function firstEntryByValue

    • Finds first entry by iterable value. Expects a map with an iterable as values.

      const map = new Map();
      map.set('hello', ['a', 'b', 'c']);
      map.set('there', ['d', 'e', 'f']);

      const entry = firstEntryByValue(map, 'e');
      // Entry is: ['there', ['d', 'e', 'f']]

      An alternative is firstEntry to search by predicate function.

      Type Parameters

      • K
      • V

      Parameters

      • map: Data.Maps.IWithEntries<K, Iterable<V, any, any>>

        Map to search

      • value: V

        Value to seek

      • isEqual: IsEqual<V> = isEqualDefault

        Filter function which checks equality. Uses JS comparer by default.

      Returns undefined | readonly [K, Iterable<V, any, any>]

      Entry, or undefined if value not found.