@cprecioso/async-iterable-helpers
    Preparing search index...

    Function flatMap

    • Maps each item to an iterable and flattens the results by one level. The mapping function may be async, and may return a sync or async iterable.

      Type Parameters

      • T
      • U

      Parameters

      • fn: (
            item: Awaited<T>,
        ) =>
            | Iterable<U, any, any>
            | AsyncIterable<U, any, any>
            | Promise<Iterable<U, any, any> | AsyncIterable<U, any, any>>

        Maps an item to an iterable of values to yield.

      Returns PipeFn<T, Awaited<U>>

      A pipe that yields the flattened mapped values.