Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace for the asynchronous version of the generic generator operators.

Index

Type aliases

Generator

Generator<T, TReturn, TNext>: EnhancedAsyncGenerator<T, TReturn, TNext>

An enhanced generator that can be used in various ways.

Most methods come both as instance (prototype) methods and as static methods. They provide equivalent functionality, but the static methods allow use on Iterator and Iterable objects without first converting to a generator.

The Async.enhance method will add additional instance methods to an ordinary generator's prototype (a new prototype, not modifying any global prototype!). It can also be used to convert Iterator and Iterable objects to Generator.

For methods which return an Async.Generator, care is take to propagate any Generator.throw and Generator.return calls to any supplied generators, so they can properly terminate.

The exceptions are [[Enhancements.flat]] (and by extension, [[Enhancements.flatMap]]), which cannot know what nested generators they might encounter in the future. Any generators encountered so far will be terminated, however.

Type parameters

  • T

    the type of values returned in the iteration result.

  • TReturn

    the type of values returned in the iteration result when the generator terminates

  • TNext

    the type of value which can be passed to .next(val).

    See also Sync.Generator

type

type: "async"

Literal type indicating an asynchronous generator. Only a type, not a value.

Functions

Const Mixin

  • Mixin<B, P, I, T, TReturn, TNext>(Base: B): Constructor<I & IEnhancements<T, any, undefined, "async">, P>
  • Given a class that implements Iterable<T, TReturn, TNext>, this returns a class that implements IEnhancements, allowing one to treat it as if it were an array, in supporting methods such as .map() and .filter().

    Usage:

    class MyAsyncIterable implements AsyncIterable<number> {
      async *[Symbol.Asynciterator]() {
         yield 1;
         yield 2;
         yield 3;
      }
    }
    
    class MyEnhancedAsyncIterable extends Async.Mixin(MyAsyncIterable) {
        constructor() {
            super();
        }
    }
    const foo = new MyEnhancedAsyncIterable();
    await foo.map(i => i * 2).asArray(); // => [2, 4, 6]
    await foo.map(i => i + 2).asArray(); // => [3, 4, 5]
    

    Type parameters

    • B: Constructor<AsyncIterable<any>, any[]>

    • P: any[]

    • I: AsyncIterable<any, I>

    • T: any

    • TReturn = any

    • TNext = undefined

    Parameters

    • Base: B

      a constructor for a class that implements AsyncIterable.

    Returns Constructor<I & IEnhancements<T, any, undefined, "async">, P>

    a new constructor for an enhanced class.

Const asArray

  • asArray<T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): GenPromise<T[]>
  • See [[Enhancements.asArray]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

    Returns GenPromise<T[]>

    Returns: Async.Generator

Const concat

  • concat<T, TReturn, TNext>(...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedAsyncGenerator<T, void | TReturn, TNext>
  • Return a generator concatenating this with the supplied generator(s).

    See [[Enhancements.concat]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]

    Returns EnhancedAsyncGenerator<T, void | TReturn, TNext>

    Returns: Async.Generator

Const enhance

  • enhance<T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedAsyncGenerator<T, TReturn, TNext>
  • Convert any AsyncIterator or AsyncIterable to a Async.Generator.

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

    Returns EnhancedAsyncGenerator<T, TReturn, TNext>

    Returns: Async.Generator

Const every

  • every<T>(p: (v: T, idx: number) => boolean | PromiseLike<boolean>, thisArg?: any): <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => GenPromise<boolean>
  • every<T_1>(p: (v: T_1, idx: number) => boolean | PromiseLike<boolean>): <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, thisArg?: any) => GenPromise<boolean>
  • every<T_2, TReturn_2, TNext_2>(p: (v: T_2, idx: number) => boolean | PromiseLike<boolean>, gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">): GenPromise<boolean>
  • every<T_3, TReturn_3, TNext_3>(p: (v: T_3, idx: number) => boolean | PromiseLike<boolean>, thisArg: any, gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">): GenPromise<boolean>
  • every<T_4, TReturn_4, TNext_4>(pred: (v: T_4, idx: number) => boolean | PromiseLike<boolean>, genOrThis?: any, gen?: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">): GenPromise<boolean> | (<XReturn, XNext>(gen: Iterable<T_4> | AsyncIterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "async"> | AsyncGenerator<T_4, XReturn, XNext> | AsyncIterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => GenPromise<boolean>)
  • See [[Enhancements.every]]

    Type parameters

    • T

    Parameters

    • p: (v: T, idx: number) => boolean | PromiseLike<boolean>
        • (v: T, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • Optional thisArg: any

    Returns <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => GenPromise<boolean>

      • <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): GenPromise<boolean>
      • Type parameters

        • TReturn

        • TNext

        Parameters

        • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

        Returns GenPromise<boolean>

  • See [[Enhancements.every]]

    Type parameters

    • T_1

    Parameters

    • p: (v: T_1, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_1, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_1
          • idx: number

          Returns boolean | PromiseLike<boolean>

    Returns <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, thisArg?: any) => GenPromise<boolean>

      • <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, thisArg?: any): GenPromise<boolean>
      • Type parameters

        • TReturn_1

        • TNext_1

        Parameters

        • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">
        • Optional thisArg: any

        Returns GenPromise<boolean>

  • See [[Enhancements.every]]

    Type parameters

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

    • p: (v: T_2, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_2, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_2
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">

    Returns GenPromise<boolean>

  • See [[Enhancements.every]]

    Type parameters

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

    • p: (v: T_3, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_3, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_3
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • thisArg: any
    • gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">

    Returns GenPromise<boolean>

  • See [[Enhancements.every]]

    Type parameters

    • T_4

    • TReturn_4

    • TNext_4

    Parameters

    • pred: (v: T_4, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_4, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_4
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • Optional genOrThis: any
    • Optional gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">

    Returns GenPromise<boolean> | (<XReturn, XNext>(gen: Iterable<T_4> | AsyncIterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "async"> | AsyncGenerator<T_4, XReturn, XNext> | AsyncIterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => GenPromise<boolean>)

Const filter

  • filter<T>(f: (v: T, idx: number) => boolean | PromiseLike<boolean>): GenOpValue<"async", T, T, []>
  • filter<T_1>(f: (v: T_1, idx: number) => boolean | PromiseLike<boolean>, thisArg: any): GenOpValue<"async", T_1, T_1, []>
  • filter<T_2, TReturn, TNext>(f: (v: T_2, idx: number) => boolean | PromiseLike<boolean>, iter: Generator<T_2, TReturn, TNext> | Iterator<T_2, TReturn, TNext> | Iterable<T_2> | Enhancements<T_2, TReturn, TNext, "async"> | AsyncGenerator<T_2, TReturn, TNext> | AsyncIterator<T_2, TReturn, TNext> | AsyncIterable<T_2> | Enhancements<T_2, TReturn, TNext, "sync">): EnhancedAsyncGenerator<T_2, TReturn, TNext>
  • filter<T_3, TReturn_1, TNext_1>(f: (v: T_3, idx: number) => boolean | PromiseLike<boolean>, thisArg: any, iter: Generator<T_3, TReturn_1, TNext_1> | Iterator<T_3, TReturn_1, TNext_1> | Iterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_3, TReturn_1, TNext_1> | AsyncIterator<T_3, TReturn_1, TNext_1> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "sync">): EnhancedAsyncGenerator<T_3, TReturn_1, TNext_1>
  • filter<T_4, TReturn_2, TNext_2>(f: (v: T_4, idx: number) => boolean | PromiseLike<boolean>, thisArg?: any, iter?: Generator<T_4, TReturn_2, TNext_2> | Iterator<T_4, TReturn_2, TNext_2> | Iterable<T_4> | Enhancements<T_4, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_4, TReturn_2, TNext_2> | AsyncIterator<T_4, TReturn_2, TNext_2> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_2, TNext_2, "sync">): EnhancedAsyncGenerator<T_4, TReturn_2, TNext_2>
  • See [[Enhancements.filter]]

    Type parameters

    • T

    Parameters

    • f: (v: T, idx: number) => boolean | PromiseLike<boolean>
        • (v: T, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T
          • idx: number

          Returns boolean | PromiseLike<boolean>

    Returns GenOpValue<"async", T, T, []>

    Returns: Async.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_1

    Parameters

    • f: (v: T_1, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_1, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_1
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • thisArg: any

    Returns GenOpValue<"async", T_1, T_1, []>

    Returns: Async.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_2

    • TReturn

    • TNext

    Parameters

    • f: (v: T_2, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_2, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_2
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • iter: Generator<T_2, TReturn, TNext> | Iterator<T_2, TReturn, TNext> | Iterable<T_2> | Enhancements<T_2, TReturn, TNext, "async"> | AsyncGenerator<T_2, TReturn, TNext> | AsyncIterator<T_2, TReturn, TNext> | AsyncIterable<T_2> | Enhancements<T_2, TReturn, TNext, "sync">

    Returns EnhancedAsyncGenerator<T_2, TReturn, TNext>

    Returns: Async.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_3

    • TReturn_1

    • TNext_1

    Parameters

    • f: (v: T_3, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_3, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_3
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • thisArg: any
    • iter: Generator<T_3, TReturn_1, TNext_1> | Iterator<T_3, TReturn_1, TNext_1> | Iterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_3, TReturn_1, TNext_1> | AsyncIterator<T_3, TReturn_1, TNext_1> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "sync">

    Returns EnhancedAsyncGenerator<T_3, TReturn_1, TNext_1>

    Returns: Async.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_4

    • TReturn_2

    • TNext_2

    Parameters

    • f: (v: T_4, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_4, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_4
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • Optional thisArg: any
    • Optional iter: Generator<T_4, TReturn_2, TNext_2> | Iterator<T_4, TReturn_2, TNext_2> | Iterable<T_4> | Enhancements<T_4, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_4, TReturn_2, TNext_2> | AsyncIterator<T_4, TReturn_2, TNext_2> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_2, TNext_2, "sync">

    Returns EnhancedAsyncGenerator<T_4, TReturn_2, TNext_2>

    Returns: Async.Generator

Const flat

  • flat<D>(depth: D): <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => EnhancedAsyncGenerator<any, TReturn, TNext>
  • flat<D_1, T_1, TReturn_1, TNext_1>(depth: D_1, gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">): EnhancedAsyncGenerator<any, TReturn_1, TNext_1>
  • flat<D_2, T_2, TReturn_2, TNext_2>(gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">, depth?: D_2): EnhancedAsyncGenerator<any, TReturn_2, TNext_2>
  • flat<D_3, T_3, TReturn_3, TNext_3>(depth: D_3 | Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">, gen?: D_3 | Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">): EnhancedAsyncGenerator<any, TReturn_3, TNext_3> | (<X, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedAsyncGenerator<any, XReturn, XNext>) | (<X_1, XReturn_1, XNext_1>(gen: Generator<X_1, XReturn_1, XNext_1> | Iterator<X_1, XReturn_1, XNext_1> | Iterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "async"> | AsyncGenerator<X_1, XReturn_1, XNext_1> | AsyncIterator<X_1, XReturn_1, XNext_1> | AsyncIterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "sync">, thisObj: any) => EnhancedAsyncGenerator<any, XReturn_1, XNext_1>)
  • See [[Enhancements.flat]]

    Type parameters

    • D: number

    Parameters

    • depth: D

    Returns <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => EnhancedAsyncGenerator<any, TReturn, TNext>

    Returns: Async.Generator

      • <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedAsyncGenerator<any, TReturn, TNext>
      • Type parameters

        • T

        • TReturn

        • TNext

        Parameters

        • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

        Returns EnhancedAsyncGenerator<any, TReturn, TNext>

  • See [[Enhancements.flat]]

    Type parameters

    • D_1: number

    • T_1

    • TReturn_1

    • TNext_1

    Parameters

    • depth: D_1
    • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">

    Returns EnhancedAsyncGenerator<any, TReturn_1, TNext_1>

    Returns: Async.Generator

  • See [[Enhancements.flat]]

    Type parameters

    • D_2: number

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

    • gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">
    • Optional depth: D_2

    Returns EnhancedAsyncGenerator<any, TReturn_2, TNext_2>

    Returns: Async.Generator

  • See [[Enhancements.flat]]

    Type parameters

    • D_3: number

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

    • depth: D_3 | Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">
    • Optional gen: D_3 | Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">

    Returns EnhancedAsyncGenerator<any, TReturn_3, TNext_3> | (<X, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedAsyncGenerator<any, XReturn, XNext>) | (<X_1, XReturn_1, XNext_1>(gen: Generator<X_1, XReturn_1, XNext_1> | Iterator<X_1, XReturn_1, XNext_1> | Iterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "async"> | AsyncGenerator<X_1, XReturn_1, XNext_1> | AsyncIterator<X_1, XReturn_1, XNext_1> | AsyncIterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "sync">, thisObj: any) => EnhancedAsyncGenerator<any, XReturn_1, XNext_1>)

    Returns: Async.Generator

Const flatMap

  • flatMap<D, R, T>(f: (v: T, idx: number) => R | PromiseLike<R>, depth: D): <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => EnhancedAsyncGenerator<R, TReturn, TNext>
  • flatMap<D_1, R_1, T_1>(f: (v: T_1, idx: number) => R_1 | PromiseLike<R_1>): <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, depth?: D_1) => EnhancedAsyncGenerator<R_1, TReturn_1, TNext_1>
  • flatMap<D_2, R_2, T_2, TReturn_2, TNext_2>(f: (v: T_2, idx: number) => R_2 | PromiseLike<R_2>, gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">): EnhancedAsyncGenerator<R_2, TReturn_2, TNext_2>
  • flatMap<D_3, R_3, T_3, TReturn_3, TNext_3>(f: (v: T_3, idx: number) => R_3 | PromiseLike<R_3>, depth: D_3, gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">): EnhancedAsyncGenerator<any, TReturn_3, TNext_3>
  • flatMap<D_4, R_4, T_4, TReturn_4, TNext_4>(f: (v: T_4, idx: number) => R_4 | PromiseLike<R_4>, depthOrGen?: D_4 | Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">, gen?: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">): EnhancedAsyncGenerator<any, TReturn_4, TNext_4> | (<X, Y, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedAsyncGenerator<Y, XReturn, XNext>) | (<X_1, Y_1, XReturn_1, XNext_1>(gen: Generator<X_1, XReturn_1, XNext_1> | Iterator<X_1, XReturn_1, XNext_1> | Iterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "async"> | AsyncGenerator<X_1, XReturn_1, XNext_1> | AsyncIterator<X_1, XReturn_1, XNext_1> | AsyncIterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "sync">, depth?: D_4) => EnhancedAsyncGenerator<Y_1, XReturn_1, XNext_1>)
  • See [[Enhancements.flatMap]]

    Type parameters

    • D: number

    • R: unknown

    • T

    Parameters

    • f: (v: T, idx: number) => R | PromiseLike<R>
        • (v: T, idx: number): R | PromiseLike<R>
        • Parameters

          • v: T
          • idx: number

          Returns R | PromiseLike<R>

    • depth: D

    Returns <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => EnhancedAsyncGenerator<R, TReturn, TNext>

    Returns: Async.Generator

      • <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedAsyncGenerator<R, TReturn, TNext>
      • Type parameters

        • TReturn

        • TNext

        Parameters

        • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

        Returns EnhancedAsyncGenerator<R, TReturn, TNext>

  • See [[Enhancements.flatMap]]

    Type parameters

    • D_1: number

    • R_1: unknown

    • T_1

    Parameters

    • f: (v: T_1, idx: number) => R_1 | PromiseLike<R_1>
        • (v: T_1, idx: number): R_1 | PromiseLike<R_1>
        • Parameters

          • v: T_1
          • idx: number

          Returns R_1 | PromiseLike<R_1>

    Returns <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, depth?: D_1) => EnhancedAsyncGenerator<R_1, TReturn_1, TNext_1>

    Returns: Async.Generator

      • <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, depth?: D_1): EnhancedAsyncGenerator<R_1, TReturn_1, TNext_1>
      • Type parameters

        • TReturn_1

        • TNext_1

        Parameters

        • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">
        • Optional depth: D_1

        Returns EnhancedAsyncGenerator<R_1, TReturn_1, TNext_1>

  • See [[Enhancements.flatMap]]

    Type parameters

    • D_2: number

    • R_2: unknown

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

    • f: (v: T_2, idx: number) => R_2 | PromiseLike<R_2>
        • (v: T_2, idx: number): R_2 | PromiseLike<R_2>
        • Parameters

          • v: T_2
          • idx: number

          Returns R_2 | PromiseLike<R_2>

    • gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">

    Returns EnhancedAsyncGenerator<R_2, TReturn_2, TNext_2>

    Returns: Async.Generator

  • See [[Enhancements.flatMap]]

    Type parameters

    • D_3: number

    • R_3: unknown

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

    • f: (v: T_3, idx: number) => R_3 | PromiseLike<R_3>
        • (v: T_3, idx: number): R_3 | PromiseLike<R_3>
        • Parameters

          • v: T_3
          • idx: number

          Returns R_3 | PromiseLike<R_3>

    • depth: D_3
    • gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">

    Returns EnhancedAsyncGenerator<any, TReturn_3, TNext_3>

    Returns: Async.Generator

  • See [[Enhancements.flatMap]]

    Type parameters

    • D_4: number

    • R_4: unknown

    • T_4

    • TReturn_4

    • TNext_4

    Parameters

    • f: (v: T_4, idx: number) => R_4 | PromiseLike<R_4>
        • (v: T_4, idx: number): R_4 | PromiseLike<R_4>
        • Parameters

          • v: T_4
          • idx: number

          Returns R_4 | PromiseLike<R_4>

    • Optional depthOrGen: D_4 | Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">
    • Optional gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">

    Returns EnhancedAsyncGenerator<any, TReturn_4, TNext_4> | (<X, Y, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedAsyncGenerator<Y, XReturn, XNext>) | (<X_1, Y_1, XReturn_1, XNext_1>(gen: Generator<X_1, XReturn_1, XNext_1> | Iterator<X_1, XReturn_1, XNext_1> | Iterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "async"> | AsyncGenerator<X_1, XReturn_1, XNext_1> | AsyncIterator<X_1, XReturn_1, XNext_1> | AsyncIterable<X_1> | Enhancements<X_1, XReturn_1, XNext_1, "sync">, depth?: D_4) => EnhancedAsyncGenerator<Y_1, XReturn_1, XNext_1>)

    Returns: Async.Generator

Const forEach

  • forEach<T, TReturn, TNext>(f: (v: T, idx: number) => void | PromiseLike<void>, thisArg: any, gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): Promise<void>
  • forEach<T_1, TReturn_1, TNext_1>(f: (v: T_1, idx: number) => void | PromiseLike<void>, gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">): Promise<void>
  • forEach<T_2>(f: (v: T_2, idx: number) => void | PromiseLike<void>, thisArg?: any): <XReturn, XNext>(gen: Generator<T_2, XReturn, XNext> | Iterator<T_2, XReturn, XNext> | Iterable<T_2> | Enhancements<T_2, XReturn, XNext, "async"> | AsyncGenerator<T_2, XReturn, XNext> | AsyncIterator<T_2, XReturn, XNext> | AsyncIterable<T_2> | Enhancements<T_2, XReturn, XNext, "sync">) => Promise<void>
  • forEach<T_3>(f: (v: T_3, idx: number) => void | PromiseLike<void>): <XReturn_1, XNext_1>(gen: Generator<T_3, XReturn_1, XNext_1> | Iterator<T_3, XReturn_1, XNext_1> | Iterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "async"> | AsyncGenerator<T_3, XReturn_1, XNext_1> | AsyncIterator<T_3, XReturn_1, XNext_1> | AsyncIterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "sync">, thisArg?: any) => Promise<void>
  • See [[Enhancements.forEach]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • f: (v: T, idx: number) => void | PromiseLike<void>
        • (v: T, idx: number): void | PromiseLike<void>
        • Parameters

          • v: T
          • idx: number

          Returns void | PromiseLike<void>

    • thisArg: any
    • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

    Returns Promise<void>

  • See [[Enhancements.forEach]]

    Type parameters

    • T_1

    • TReturn_1

    • TNext_1

    Parameters

    • f: (v: T_1, idx: number) => void | PromiseLike<void>
        • (v: T_1, idx: number): void | PromiseLike<void>
        • Parameters

          • v: T_1
          • idx: number

          Returns void | PromiseLike<void>

    • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">

    Returns Promise<void>

  • See [[Enhancements.forEach]]

    Type parameters

    • T_2

    Parameters

    • f: (v: T_2, idx: number) => void | PromiseLike<void>
        • (v: T_2, idx: number): void | PromiseLike<void>
        • Parameters

          • v: T_2
          • idx: number

          Returns void | PromiseLike<void>

    • Optional thisArg: any

    Returns <XReturn, XNext>(gen: Generator<T_2, XReturn, XNext> | Iterator<T_2, XReturn, XNext> | Iterable<T_2> | Enhancements<T_2, XReturn, XNext, "async"> | AsyncGenerator<T_2, XReturn, XNext> | AsyncIterator<T_2, XReturn, XNext> | AsyncIterable<T_2> | Enhancements<T_2, XReturn, XNext, "sync">) => Promise<void>

      • <XReturn, XNext>(gen: Generator<T_2, XReturn, XNext> | Iterator<T_2, XReturn, XNext> | Iterable<T_2> | Enhancements<T_2, XReturn, XNext, "async"> | AsyncGenerator<T_2, XReturn, XNext> | AsyncIterator<T_2, XReturn, XNext> | AsyncIterable<T_2> | Enhancements<T_2, XReturn, XNext, "sync">): Promise<void>
      • Type parameters

        • XReturn

        • XNext

        Parameters

        • gen: Generator<T_2, XReturn, XNext> | Iterator<T_2, XReturn, XNext> | Iterable<T_2> | Enhancements<T_2, XReturn, XNext, "async"> | AsyncGenerator<T_2, XReturn, XNext> | AsyncIterator<T_2, XReturn, XNext> | AsyncIterable<T_2> | Enhancements<T_2, XReturn, XNext, "sync">

        Returns Promise<void>

  • See [[Enhancements.forEach]]

    Type parameters

    • T_3

    Parameters

    • f: (v: T_3, idx: number) => void | PromiseLike<void>
        • (v: T_3, idx: number): void | PromiseLike<void>
        • Parameters

          • v: T_3
          • idx: number

          Returns void | PromiseLike<void>

    Returns <XReturn_1, XNext_1>(gen: Generator<T_3, XReturn_1, XNext_1> | Iterator<T_3, XReturn_1, XNext_1> | Iterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "async"> | AsyncGenerator<T_3, XReturn_1, XNext_1> | AsyncIterator<T_3, XReturn_1, XNext_1> | AsyncIterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "sync">, thisArg?: any) => Promise<void>

      • <XReturn_1, XNext_1>(gen: Generator<T_3, XReturn_1, XNext_1> | Iterator<T_3, XReturn_1, XNext_1> | Iterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "async"> | AsyncGenerator<T_3, XReturn_1, XNext_1> | AsyncIterator<T_3, XReturn_1, XNext_1> | AsyncIterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "sync">, thisArg?: any): Promise<void>
      • Type parameters

        • XReturn_1

        • XNext_1

        Parameters

        • gen: Generator<T_3, XReturn_1, XNext_1> | Iterator<T_3, XReturn_1, XNext_1> | Iterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "async"> | AsyncGenerator<T_3, XReturn_1, XNext_1> | AsyncIterator<T_3, XReturn_1, XNext_1> | AsyncIterable<T_3> | Enhancements<T_3, XReturn_1, XNext_1, "sync">
        • Optional thisArg: any

        Returns Promise<void>

Const join

  • join(sep: string): <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => GenPromise<string>
  • join<T_1, TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, sep?: string): GenPromise<string>
  • join<T_2, TReturn_2, TNext_2>(genOrSeparator: string | Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">, sep?: string): GenPromise<string> | (<X>(gen: Generator<X, TReturn_2, TNext_2> | Iterator<X, TReturn_2, TNext_2> | Iterable<X> | Enhancements<X, TReturn_2, TNext_2, "async"> | AsyncGenerator<X, TReturn_2, TNext_2> | AsyncIterator<X, TReturn_2, TNext_2> | AsyncIterable<X> | Enhancements<X, TReturn_2, TNext_2, "sync">) => GenPromise<string>)
  • See [[Enhancements.join]]

    Parameters

    • sep: string

    Returns <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => GenPromise<string>

      • <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): GenPromise<string>
      • Type parameters

        • T

        • TReturn

        • TNext

        Parameters

        • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

        Returns GenPromise<string>

  • See [[Enhancements.join]]

    Type parameters

    • T_1

    • TReturn_1

    • TNext_1

    Parameters

    • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">
    • Optional sep: string

    Returns GenPromise<string>

  • See [[Enhancements.join]]

    Type parameters

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

    • genOrSeparator: string | Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">
    • Optional sep: string

    Returns GenPromise<string> | (<X>(gen: Generator<X, TReturn_2, TNext_2> | Iterator<X, TReturn_2, TNext_2> | Iterable<X> | Enhancements<X, TReturn_2, TNext_2, "async"> | AsyncGenerator<X, TReturn_2, TNext_2> | AsyncIterator<X, TReturn_2, TNext_2> | AsyncIterable<X> | Enhancements<X, TReturn_2, TNext_2, "sync">) => GenPromise<string>)

Const limit

  • limit<T, TReturn, TNext>(max: number, gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedAsyncGenerator<T, TReturn, TNext>
  • limit(max: number): GenOp<"async", []>

Const map

  • map<T, V>(f: (v: T, idx: number) => V | PromiseLike<V>): GenOpValue<"async", T, V, []>
  • map<T_1, V_1>(f: (v: T_1, idx: number) => V_1 | PromiseLike<V_1>, thisArg?: any): GenOpValue<"async", T_1, V_1, []>
  • map<T_2, V_2, TReturn, TNext>(f: (v: T_2, idx: number) => V_2 | PromiseLike<V_2>, gen: Generator<T_2, TReturn, TNext> | Iterator<T_2, TReturn, TNext> | Iterable<T_2> | Enhancements<T_2, TReturn, TNext, "async"> | AsyncGenerator<T_2, TReturn, TNext> | AsyncIterator<T_2, TReturn, TNext> | AsyncIterable<T_2> | Enhancements<T_2, TReturn, TNext, "sync">): EnhancedAsyncGenerator<V_2, TReturn, TNext>
  • map<T_3, V_3, TReturn_1, TNext_1>(f: (v: T_3, idx: number) => V_3 | PromiseLike<V_3>, thisArg: any, gen: Generator<T_3, TReturn_1, TNext_1> | Iterator<T_3, TReturn_1, TNext_1> | Iterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_3, TReturn_1, TNext_1> | AsyncIterator<T_3, TReturn_1, TNext_1> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "sync">): EnhancedAsyncGenerator<V_3, TReturn_1, TNext_1>
  • See [[Enhancements.map]]

    Type parameters

    • T

    • V

    Parameters

    • f: (v: T, idx: number) => V | PromiseLike<V>
        • (v: T, idx: number): V | PromiseLike<V>
        • Parameters

          • v: T
          • idx: number

          Returns V | PromiseLike<V>

    Returns GenOpValue<"async", T, V, []>

    Returns: Async.Generator

  • See [[Enhancements.map]]

    Type parameters

    • T_1

    • V_1

    Parameters

    • f: (v: T_1, idx: number) => V_1 | PromiseLike<V_1>
        • (v: T_1, idx: number): V_1 | PromiseLike<V_1>
        • Parameters

          • v: T_1
          • idx: number

          Returns V_1 | PromiseLike<V_1>

    • Optional thisArg: any

    Returns GenOpValue<"async", T_1, V_1, []>

    Returns: Async.Generator

  • See [[Enhancements.map]]

    Type parameters

    • T_2

    • V_2

    • TReturn

    • TNext

    Parameters

    • f: (v: T_2, idx: number) => V_2 | PromiseLike<V_2>
        • (v: T_2, idx: number): V_2 | PromiseLike<V_2>
        • Parameters

          • v: T_2
          • idx: number

          Returns V_2 | PromiseLike<V_2>

    • gen: Generator<T_2, TReturn, TNext> | Iterator<T_2, TReturn, TNext> | Iterable<T_2> | Enhancements<T_2, TReturn, TNext, "async"> | AsyncGenerator<T_2, TReturn, TNext> | AsyncIterator<T_2, TReturn, TNext> | AsyncIterable<T_2> | Enhancements<T_2, TReturn, TNext, "sync">

    Returns EnhancedAsyncGenerator<V_2, TReturn, TNext>

    Returns: Async.Generator

  • See [[Enhancements.map]]

    Type parameters

    • T_3

    • V_3

    • TReturn_1

    • TNext_1

    Parameters

    • f: (v: T_3, idx: number) => V_3 | PromiseLike<V_3>
        • (v: T_3, idx: number): V_3 | PromiseLike<V_3>
        • Parameters

          • v: T_3
          • idx: number

          Returns V_3 | PromiseLike<V_3>

    • thisArg: any
    • gen: Generator<T_3, TReturn_1, TNext_1> | Iterator<T_3, TReturn_1, TNext_1> | Iterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_3, TReturn_1, TNext_1> | AsyncIterator<T_3, TReturn_1, TNext_1> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_1, TNext_1, "sync">

    Returns EnhancedAsyncGenerator<V_3, TReturn_1, TNext_1>

    Returns: Async.Generator

Const merge

  • merge<T, TReturn, TNext>(...sources: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedAsyncGenerator<T, void | TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...sources: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]

    Returns EnhancedAsyncGenerator<T, void | TReturn, TNext>

Const of

Const reduce

  • reduce<A, T, TReturn, TNext>(f: (acc: A | T, v: T) => A | PromiseLike<A>, gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): GenPromise<A>
  • reduce<A_1, T_1, TReturn_1, TNext_1>(f: (acc: A_1 | T_1, v: T_1) => A_1 | PromiseLike<A_1>): (gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">) => GenPromise<A_1>
  • reduce<A_2, T_2>(f: (acc: A_2, v: T_2) => A_2 | PromiseLike<A_2>): <TReturn_2, TNext_2>(init: A_2, gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">) => GenPromise<A_2>
  • reduce<A_3, T_3, TReturn_3, TNext_3>(f: (acc: A_3, v: T_3) => A_3 | PromiseLike<A_3>, init: A_3, gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">): GenPromise<A_3>
  • reduce<A_4, T_4>(f: (acc: A_4, v: T_4) => A_4 | PromiseLike<A_4>, init: A_4): <TReturn_4, TNext_4>(gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">) => GenPromise<A_4>
  • reduce<A_5, T_5, TReturn_5, TNext_5>(f: (acc: A_5 | T_5, v: T_5) => A_5 | PromiseLike<A_5>, initOrGen?: GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5) | Generator<T_5, TReturn_5, TNext_5> | Iterator<T_5, TReturn_5, TNext_5> | Iterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "async"> | AsyncGenerator<T_5, TReturn_5, TNext_5> | AsyncIterator<T_5, TReturn_5, TNext_5> | AsyncIterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "sync">, gen?: Generator<T_5, TReturn_5, TNext_5> | Iterator<T_5, TReturn_5, TNext_5> | Iterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "async"> | AsyncGenerator<T_5, TReturn_5, TNext_5> | AsyncIterator<T_5, TReturn_5, TNext_5> | AsyncIterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "sync">): GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5) | (<XReturn, XNext>(gen: Iterable<T_5> | AsyncIterable<T_5> | Generator<T_5, XReturn, XNext> | Iterator<T_5, XReturn, XNext> | Enhancements<T_5, XReturn, XNext, "async"> | AsyncGenerator<T_5, XReturn, XNext> | AsyncIterator<T_5, XReturn, XNext> | Enhancements<T_5, XReturn, XNext, "sync">) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5)) | ((f: (acc: A_5, v: T_5) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5), init: A_5) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5)) | ((f: (acc: A_5 | T_5, v: T_5) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5)) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5))
  • See [[Enhancements.reduce]]

    Type parameters

    • A

    • T

    • TReturn

    • TNext

    Parameters

    • f: (acc: A | T, v: T) => A | PromiseLike<A>
        • (acc: A | T, v: T): A | PromiseLike<A>
        • Parameters

          • acc: A | T
          • v: T

          Returns A | PromiseLike<A>

    • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

    Returns GenPromise<A>

  • See [[Enhancements.reduce]]

    Type parameters

    • A_1

    • T_1

    • TReturn_1

    • TNext_1

    Parameters

    • f: (acc: A_1 | T_1, v: T_1) => A_1 | PromiseLike<A_1>
        • (acc: A_1 | T_1, v: T_1): A_1 | PromiseLike<A_1>
        • Parameters

          • acc: A_1 | T_1
          • v: T_1

          Returns A_1 | PromiseLike<A_1>

    Returns (gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">) => GenPromise<A_1>

      • (gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">): GenPromise<A_1>
      • Parameters

        • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">

        Returns GenPromise<A_1>

  • See [[Enhancements.reduce]]

    Type parameters

    • A_2

    • T_2

    Parameters

    • f: (acc: A_2, v: T_2) => A_2 | PromiseLike<A_2>
        • (acc: A_2, v: T_2): A_2 | PromiseLike<A_2>
        • Parameters

          • acc: A_2
          • v: T_2

          Returns A_2 | PromiseLike<A_2>

    Returns <TReturn_2, TNext_2>(init: A_2, gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">) => GenPromise<A_2>

      • <TReturn_2, TNext_2>(init: A_2, gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">): GenPromise<A_2>
      • Type parameters

        • TReturn_2

        • TNext_2

        Parameters

        • init: A_2
        • gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">

        Returns GenPromise<A_2>

  • See [[Enhancements.reduce]]

    Type parameters

    • A_3

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

    • f: (acc: A_3, v: T_3) => A_3 | PromiseLike<A_3>
        • (acc: A_3, v: T_3): A_3 | PromiseLike<A_3>
        • Parameters

          • acc: A_3
          • v: T_3

          Returns A_3 | PromiseLike<A_3>

    • init: A_3
    • gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">

    Returns GenPromise<A_3>

  • See [[Enhancements.reduce]]

    Type parameters

    • A_4

    • T_4

    Parameters

    • f: (acc: A_4, v: T_4) => A_4 | PromiseLike<A_4>
        • (acc: A_4, v: T_4): A_4 | PromiseLike<A_4>
        • Parameters

          • acc: A_4
          • v: T_4

          Returns A_4 | PromiseLike<A_4>

    • init: A_4

    Returns <TReturn_4, TNext_4>(gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">) => GenPromise<A_4>

      • <TReturn_4, TNext_4>(gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">): GenPromise<A_4>
      • Type parameters

        • TReturn_4

        • TNext_4

        Parameters

        • gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">

        Returns GenPromise<A_4>

  • See [[Enhancements.reduce]]

    Type parameters

    • A_5

    • T_5

    • TReturn_5

    • TNext_5

    Parameters

    • f: (acc: A_5 | T_5, v: T_5) => A_5 | PromiseLike<A_5>
        • (acc: A_5 | T_5, v: T_5): A_5 | PromiseLike<A_5>
        • Parameters

          • acc: A_5 | T_5
          • v: T_5

          Returns A_5 | PromiseLike<A_5>

    • Optional initOrGen: GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5) | Generator<T_5, TReturn_5, TNext_5> | Iterator<T_5, TReturn_5, TNext_5> | Iterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "async"> | AsyncGenerator<T_5, TReturn_5, TNext_5> | AsyncIterator<T_5, TReturn_5, TNext_5> | AsyncIterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "sync">
    • Optional gen: Generator<T_5, TReturn_5, TNext_5> | Iterator<T_5, TReturn_5, TNext_5> | Iterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "async"> | AsyncGenerator<T_5, TReturn_5, TNext_5> | AsyncIterator<T_5, TReturn_5, TNext_5> | AsyncIterable<T_5> | Enhancements<T_5, TReturn_5, TNext_5, "sync">

    Returns GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5) | (<XReturn, XNext>(gen: Iterable<T_5> | AsyncIterable<T_5> | Generator<T_5, XReturn, XNext> | Iterator<T_5, XReturn, XNext> | Enhancements<T_5, XReturn, XNext, "async"> | AsyncGenerator<T_5, XReturn, XNext> | AsyncIterator<T_5, XReturn, XNext> | Enhancements<T_5, XReturn, XNext, "sync">) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5)) | ((f: (acc: A_5, v: T_5) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5), init: A_5) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5)) | ((f: (acc: A_5 | T_5, v: T_5) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5)) => GenPromise<A_5> | (A_5 extends PromiseLike<R> ? R : A_5))

Const repeat

Const repeatLast

  • repeatLast<T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">, max: number): EnhancedAsyncGenerator<T, void | TReturn, TNext>
  • See [[Enhancements.repeatLast]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">
    • max: number

    Returns EnhancedAsyncGenerator<T, void | TReturn, TNext>

    Returns: Async.Generator

Const slice

  • slice(start: number, end: number): <X, XReturn, XNext>(iter: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedAsyncGenerator<X, undefined | XReturn, XNext>
  • slice<T, TReturn, TNext>(start: number, end: number, iter: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedAsyncGenerator<T, undefined | TReturn, TNext>
  • slice<T_1, TReturn_1, TNext_1>(start: number, end: number, iter?: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">): EnhancedAsyncGenerator<T_1, undefined | TReturn_1, TNext_1> | (<X_1, XReturn_1, XNext_1>(gen: Generator<X_1, undefined | XReturn_1, XNext_1> | Iterator<X_1, undefined | XReturn_1, XNext_1> | Iterable<X_1> | Enhancements<X_1, undefined | XReturn_1, XNext_1, "async"> | AsyncGenerator<X_1, undefined | XReturn_1, XNext_1> | AsyncIterator<X_1, undefined | XReturn_1, XNext_1> | AsyncIterable<X_1> | Enhancements<X_1, undefined | XReturn_1, XNext_1, "sync">) => EnhancedAsyncGenerator<X_1, undefined | XReturn_1, XNext_1>)
  • See [[Enhancements.slice]]

    Parameters

    • start: number
    • end: number

    Returns <X, XReturn, XNext>(iter: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedAsyncGenerator<X, undefined | XReturn, XNext>

    Returns: Async.Generator

      • <X, XReturn, XNext>(iter: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">): EnhancedAsyncGenerator<X, undefined | XReturn, XNext>
      • Type parameters

        • X

        • XReturn

        • XNext

        Parameters

        • iter: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "async"> | AsyncGenerator<X, XReturn, XNext> | AsyncIterator<X, XReturn, XNext> | AsyncIterable<X> | Enhancements<X, XReturn, XNext, "sync">

        Returns EnhancedAsyncGenerator<X, undefined | XReturn, XNext>

  • See [[Enhancements.slice]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • start: number
    • end: number
    • iter: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

    Returns EnhancedAsyncGenerator<T, undefined | TReturn, TNext>

    Returns: Async.Generator

  • See [[Enhancements.slice]]

    Type parameters

    • T_1

    • TReturn_1

    • TNext_1

    Parameters

    • start: number
    • end: number
    • Optional iter: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">

    Returns EnhancedAsyncGenerator<T_1, undefined | TReturn_1, TNext_1> | (<X_1, XReturn_1, XNext_1>(gen: Generator<X_1, undefined | XReturn_1, XNext_1> | Iterator<X_1, undefined | XReturn_1, XNext_1> | Iterable<X_1> | Enhancements<X_1, undefined | XReturn_1, XNext_1, "async"> | AsyncGenerator<X_1, undefined | XReturn_1, XNext_1> | AsyncIterator<X_1, undefined | XReturn_1, XNext_1> | AsyncIterable<X_1> | Enhancements<X_1, undefined | XReturn_1, XNext_1, "sync">) => EnhancedAsyncGenerator<X_1, undefined | XReturn_1, XNext_1>)

    Returns: Async.Generator

Const some

  • some<T>(p: (v: T, idx: number) => boolean | PromiseLike<boolean>, thisArg?: any): <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => GenPromise<boolean>
  • some<T_1>(p: (v: T_1, idx: number) => boolean | PromiseLike<boolean>): <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, thisArg?: any) => GenPromise<boolean>
  • some<T_2, TReturn_2, TNext_2>(p: (v: T_2, idx: number) => boolean | PromiseLike<boolean>, gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">): GenPromise<boolean>
  • some<T_3, TReturn_3, TNext_3>(p: (v: T_3, idx: number) => boolean | PromiseLike<boolean>, thisArg: any, gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">): GenPromise<boolean>
  • some<T_4, TReturn_4, TNext_4>(pred: (v: T_4, idx: number) => boolean | PromiseLike<boolean>, thisOrGen?: any, gen?: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">): GenPromise<boolean> | (<XReturn, XNext>(gen: Iterable<T_4> | AsyncIterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "async"> | AsyncGenerator<T_4, XReturn, XNext> | AsyncIterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => GenPromise<boolean>)
  • See [[Enhancements.some]]

    Type parameters

    • T

    Parameters

    • p: (v: T, idx: number) => boolean | PromiseLike<boolean>
        • (v: T, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • Optional thisArg: any

    Returns <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">) => GenPromise<boolean>

      • <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">): GenPromise<boolean>
      • Type parameters

        • TReturn

        • TNext

        Parameters

        • gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">

        Returns GenPromise<boolean>

  • See [[Enhancements.some]]

    Type parameters

    • T_1

    Parameters

    • p: (v: T_1, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_1, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_1
          • idx: number

          Returns boolean | PromiseLike<boolean>

    Returns <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, thisArg?: any) => GenPromise<boolean>

      • <TReturn_1, TNext_1>(gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">, thisArg?: any): GenPromise<boolean>
      • Type parameters

        • TReturn_1

        • TNext_1

        Parameters

        • gen: Generator<T_1, TReturn_1, TNext_1> | Iterator<T_1, TReturn_1, TNext_1> | Iterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "async"> | AsyncGenerator<T_1, TReturn_1, TNext_1> | AsyncIterator<T_1, TReturn_1, TNext_1> | AsyncIterable<T_1> | Enhancements<T_1, TReturn_1, TNext_1, "sync">
        • Optional thisArg: any

        Returns GenPromise<boolean>

  • See [[Enhancements.some]]

    Type parameters

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

    • p: (v: T_2, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_2, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_2
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • gen: Generator<T_2, TReturn_2, TNext_2> | Iterator<T_2, TReturn_2, TNext_2> | Iterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "async"> | AsyncGenerator<T_2, TReturn_2, TNext_2> | AsyncIterator<T_2, TReturn_2, TNext_2> | AsyncIterable<T_2> | Enhancements<T_2, TReturn_2, TNext_2, "sync">

    Returns GenPromise<boolean>

  • See [[Enhancements.some]]

    Type parameters

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

    • p: (v: T_3, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_3, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_3
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • thisArg: any
    • gen: Generator<T_3, TReturn_3, TNext_3> | Iterator<T_3, TReturn_3, TNext_3> | Iterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "async"> | AsyncGenerator<T_3, TReturn_3, TNext_3> | AsyncIterator<T_3, TReturn_3, TNext_3> | AsyncIterable<T_3> | Enhancements<T_3, TReturn_3, TNext_3, "sync">

    Returns GenPromise<boolean>

  • See [[Enhancements.some]]

    Type parameters

    • T_4

    • TReturn_4 = T_4

    • TNext_4 = T_4

    Parameters

    • pred: (v: T_4, idx: number) => boolean | PromiseLike<boolean>
        • (v: T_4, idx: number): boolean | PromiseLike<boolean>
        • Parameters

          • v: T_4
          • idx: number

          Returns boolean | PromiseLike<boolean>

    • Optional thisOrGen: any
    • Optional gen: Generator<T_4, TReturn_4, TNext_4> | Iterator<T_4, TReturn_4, TNext_4> | Iterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "async"> | AsyncGenerator<T_4, TReturn_4, TNext_4> | AsyncIterator<T_4, TReturn_4, TNext_4> | AsyncIterable<T_4> | Enhancements<T_4, TReturn_4, TNext_4, "sync">

    Returns GenPromise<boolean> | (<XReturn, XNext>(gen: Iterable<T_4> | AsyncIterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "async"> | AsyncGenerator<T_4, XReturn, XNext> | AsyncIterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => GenPromise<boolean>)

Const sort

  • sort<T>(cmp?: (a: T, b: T) => number): <XReturn, XNext>(...sources: (Generator<T, XReturn, XNext> | Iterator<T, XReturn, XNext> | Iterable<T> | Enhancements<T, XReturn, XNext, "async"> | AsyncGenerator<T, XReturn, XNext> | AsyncIterator<T, XReturn, XNext> | AsyncIterable<T> | Enhancements<T, XReturn, XNext, "sync">)[]) => GenPromise<T[]>
  • See [[Enhancements.sort]]

    Type parameters

    • T

    Parameters

    • Optional cmp: (a: T, b: T) => number
        • (a: T, b: T): number
        • Parameters

          • a: T
          • b: T

          Returns number

    Returns <XReturn, XNext>(...sources: (Generator<T, XReturn, XNext> | Iterator<T, XReturn, XNext> | Iterable<T> | Enhancements<T, XReturn, XNext, "async"> | AsyncGenerator<T, XReturn, XNext> | AsyncIterator<T, XReturn, XNext> | AsyncIterable<T> | Enhancements<T, XReturn, XNext, "sync">)[]) => GenPromise<T[]>

      • <XReturn, XNext>(...sources: (Generator<T, XReturn, XNext> | Iterator<T, XReturn, XNext> | Iterable<T> | Enhancements<T, XReturn, XNext, "async"> | AsyncGenerator<T, XReturn, XNext> | AsyncIterator<T, XReturn, XNext> | AsyncIterable<T> | Enhancements<T, XReturn, XNext, "sync">)[]): GenPromise<T[]>
      • Type parameters

        • XReturn

        • XNext

        Parameters

        • Rest ...sources: (Generator<T, XReturn, XNext> | Iterator<T, XReturn, XNext> | Iterable<T> | Enhancements<T, XReturn, XNext, "async"> | AsyncGenerator<T, XReturn, XNext> | AsyncIterator<T, XReturn, XNext> | AsyncIterable<T> | Enhancements<T, XReturn, XNext, "sync">)[]

        Returns GenPromise<T[]>

Const wrap

  • wrap<T, PARAMS>(fn: (...args: PARAMS) => AsyncIterator<T, any, undefined>, ...args: PARAMS): AsyncFunctionWrapper<T, PARAMS>
  • Turn a function that returns an AsyncIterator<T> into an AsyncIterable<T> object which can be repeatedly iterated over, invoking the function each time to produce a new AsyncIterator<T>.

    Type parameters

    • T = any

    • PARAMS: any[] = any[]

    Parameters

    • fn: (...args: PARAMS) => AsyncIterator<T, any, undefined>

      A function that returns an AsyncIterator<T>

        • (...args: PARAMS): AsyncIterator<T, any, undefined>
        • Parameters

          • Rest ...args: PARAMS

          Returns AsyncIterator<T, any, undefined>

    • Rest ...args: PARAMS

      Arguments to be passed to the function

    Returns AsyncFunctionWrapper<T, PARAMS>

Const zip

  • zip<T, TReturn, TNext>(...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedAsyncGenerator<T[], TReturn, TNext>
  • See [[Enhancements.zip]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "async"> | AsyncGenerator<T, TReturn, TNext> | AsyncIterator<T, TReturn, TNext> | AsyncIterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]

    Returns EnhancedAsyncGenerator<T[], TReturn, TNext>

    Returns: Async.Generator

Generated using TypeDoc