Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace for the aynchronous version of the generic generator operators.

Index

Type aliases

Generator

Generator<T, TReturn, TNext>: EnhancedGenerator<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 Sync.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 Sync.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: "sync"

Literal type indicating a synchronous 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, "sync">, P>
  • Given an abstract 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 MySyncIterable implements Iterable<number> {
      *[Symbol.iterator]() {
         yield 1;
         yield 2;
         yield 3;
      }
    }
    
    class MyEnhancedSyncIterable extends Sync.Mixin(MySyncIterable) {
        constructor() {
            super();
        }
    }
    const foo = new MyEnhancedSyncIterable();
    foo.map(i => i * 2).asArray(); // => [2, 4, 6]
    foo.map(i => i + 2).asArray(); // => [3, 4, 5]
    

    Type parameters

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

    • P: any[]

    • I: Iterable<any, I>

    • T: any

    • TReturn = any

    • TNext = undefined

    Parameters

    • Base: B

      a constructor for a class that implements Iterable.

    Returns Constructor<I & IEnhancements<T, any, undefined, "sync">, 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, "sync">): T[]

Const concat

  • concat<T, TReturn, TNext>(...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedGenerator<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, "sync">)[]

    Returns EnhancedGenerator<T, void | TReturn, TNext>

    Returns: Sync.Generator

Const enhance

  • enhance<T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedGenerator<T, TReturn, TNext>

Const every

  • every<T>(p: (v: T, idx: number) => boolean, thisArg?: any): <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">) => boolean
  • every<T_1>(p: (v: T_1, idx: number) => 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, "sync">, thisArg?: any) => boolean
  • every<T_2, TReturn_2, TNext_2>(p: (v: T_2, idx: number) => 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, "sync">): boolean
  • every<T_3, TReturn_3, TNext_3>(p: (v: T_3, idx: number) => 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, "sync">): boolean
  • every<T_4, TReturn_4, TNext_4>(pred: (v: T_4, idx: number) => 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, "sync">): boolean | (<XReturn, XNext>(gen: Iterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => boolean)
  • See [[Enhancements.every]]

    Type parameters

    • T

    Parameters

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

          • v: T
          • idx: number

          Returns boolean

    • Optional thisArg: any

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

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

        • TReturn

        • TNext

        Parameters

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

        Returns boolean

  • See [[Enhancements.every]]

    Type parameters

    • T_1

    Parameters

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

          • v: T_1
          • idx: number

          Returns 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, "sync">, thisArg?: any) => 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, "sync">, thisArg?: any): 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, "sync">
        • Optional thisArg: any

        Returns boolean

  • See [[Enhancements.every]]

    Type parameters

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

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

          • v: T_2
          • idx: number

          Returns 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, "sync">

    Returns boolean

  • See [[Enhancements.every]]

    Type parameters

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

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

          • v: T_3
          • idx: number

          Returns 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, "sync">

    Returns boolean

  • See [[Enhancements.every]]

    Type parameters

    • T_4

    • TReturn_4

    • TNext_4

    Parameters

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

          • v: T_4
          • idx: number

          Returns 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, "sync">

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

Const filter

  • filter<T>(f: (v: T, idx: number) => boolean): GenOpValue<"sync", T, T, []>
  • filter<T_1>(f: (v: T_1, idx: number) => boolean, thisArg: any): GenOpValue<"sync", T_1, T_1, []>
  • filter<T_2, TReturn, TNext>(f: (v: T_2, idx: number) => boolean, iter: Generator<T_2, TReturn, TNext> | Iterator<T_2, TReturn, TNext> | Iterable<T_2> | Enhancements<T_2, TReturn, TNext, "sync">): EnhancedGenerator<T_2, TReturn, TNext>
  • filter<T_3, TReturn_1, TNext_1>(f: (v: T_3, idx: number) => 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, "sync">): EnhancedGenerator<T_3, TReturn_1, TNext_1>
  • filter<T_4, TReturn_2, TNext_2>(f: (v: T_4, idx: number) => 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, "sync">): EnhancedGenerator<T_4, TReturn_2, TNext_2>
  • See [[Enhancements.filter]]

    Type parameters

    • T

    Parameters

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

          • v: T
          • idx: number

          Returns boolean

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

    Returns: Sync.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_1

    Parameters

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

          • v: T_1
          • idx: number

          Returns boolean

    • thisArg: any

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

    Returns: Sync.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_2

    • TReturn

    • TNext

    Parameters

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

          • v: T_2
          • idx: number

          Returns boolean

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

    Returns EnhancedGenerator<T_2, TReturn, TNext>

    Returns: Sync.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_3

    • TReturn_1

    • TNext_1

    Parameters

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

          • v: T_3
          • idx: number

          Returns 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, "sync">

    Returns EnhancedGenerator<T_3, TReturn_1, TNext_1>

    Returns: Sync.Generator

  • See [[Enhancements.filter]]

    Type parameters

    • T_4

    • TReturn_2

    • TNext_2

    Parameters

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

          • v: T_4
          • idx: number

          Returns 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, "sync">

    Returns EnhancedGenerator<T_4, TReturn_2, TNext_2>

    Returns: Sync.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, "sync">) => EnhancedGenerator<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, "sync">): EnhancedGenerator<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, "sync">, depth?: D_2): EnhancedGenerator<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, "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, "sync">): EnhancedGenerator<any, TReturn_3, TNext_3> | (<X, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedGenerator<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, "sync">, thisObj: any) => EnhancedGenerator<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, "sync">) => EnhancedGenerator<any, TReturn, TNext>

    Returns: Sync.Generator

      • <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedGenerator<any, TReturn, TNext>
      • Type parameters

        • T

        • TReturn

        • TNext

        Parameters

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

        Returns EnhancedGenerator<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, "sync">

    Returns EnhancedGenerator<any, TReturn_1, TNext_1>

    Returns: Sync.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, "sync">
    • Optional depth: D_2

    Returns EnhancedGenerator<any, TReturn_2, TNext_2>

    Returns: Sync.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, "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, "sync">

    Returns EnhancedGenerator<any, TReturn_3, TNext_3> | (<X, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedGenerator<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, "sync">, thisObj: any) => EnhancedGenerator<any, XReturn_1, XNext_1>)

    Returns: Sync.Generator

Const flatMap

  • flatMap<D, R, T>(f: (v: T, idx: number) => R, depth: D): <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">) => EnhancedGenerator<R, TReturn, TNext>
  • flatMap<D_1, R_1, T_1>(f: (v: T_1, idx: number) => 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, "sync">, depth?: D_1) => EnhancedGenerator<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, 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, "sync">): EnhancedGenerator<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, 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, "sync">): EnhancedGenerator<any, TReturn_3, TNext_3>
  • flatMap<D_4, R_4, T_4, TReturn_4, TNext_4>(f: (v: T_4, idx: number) => 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, "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, "sync">): EnhancedGenerator<any, TReturn_4, TNext_4> | (<X, Y, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedGenerator<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, "sync">, depth?: D_4) => EnhancedGenerator<Y_1, XReturn_1, XNext_1>)
  • See [[Enhancements.flatMap]]

    Type parameters

    • D: number

    • R: unknown

    • T

    Parameters

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

          • v: T
          • idx: number

          Returns R

    • depth: D

    Returns <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">) => EnhancedGenerator<R, TReturn, TNext>

    Returns: Sync.Generator

      • <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">): EnhancedGenerator<R, TReturn, TNext>
      • Type parameters

        • TReturn

        • TNext

        Parameters

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

        Returns EnhancedGenerator<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
        • (v: T_1, idx: number): R_1
        • Parameters

          • v: T_1
          • idx: number

          Returns 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, "sync">, depth?: D_1) => EnhancedGenerator<R_1, TReturn_1, TNext_1>

    Returns: Sync.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, "sync">, depth?: D_1): EnhancedGenerator<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, "sync">
        • Optional depth: D_1

        Returns EnhancedGenerator<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
        • (v: T_2, idx: number): R_2
        • Parameters

          • v: T_2
          • idx: number

          Returns 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, "sync">

    Returns EnhancedGenerator<R_2, TReturn_2, TNext_2>

    Returns: Sync.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
        • (v: T_3, idx: number): R_3
        • Parameters

          • v: T_3
          • idx: number

          Returns 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, "sync">

    Returns EnhancedGenerator<any, TReturn_3, TNext_3>

    Returns: Sync.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
        • (v: T_4, idx: number): R_4
        • Parameters

          • v: T_4
          • idx: number

          Returns 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, "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, "sync">

    Returns EnhancedGenerator<any, TReturn_4, TNext_4> | (<X, Y, XReturn, XNext>(gen: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "sync">) => EnhancedGenerator<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, "sync">, depth?: D_4) => EnhancedGenerator<Y_1, XReturn_1, XNext_1>)

    Returns: Sync.Generator

Const forEach

  • forEach<T, TReturn, TNext>(f: (v: T, idx: number) => void, thisArg: any, gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">): void
  • forEach<T_1, TReturn_1, TNext_1>(f: (v: T_1, idx: number) => 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, "sync">): void
  • forEach<T_2>(f: (v: T_2, idx: number) => void, thisArg?: any): <XReturn, XNext>(gen: Generator<T_2, XReturn, XNext> | Iterator<T_2, XReturn, XNext> | Iterable<T_2> | Enhancements<T_2, XReturn, XNext, "sync">) => void
  • forEach<T_3>(f: (v: T_3, idx: number) => 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, "sync">, thisArg?: any) => void
  • See [[Enhancements.forEach]]

    Type parameters

    • T

    • TReturn

    • TNext

    Parameters

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

          • v: T
          • idx: number

          Returns void

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

    Returns void

  • See [[Enhancements.forEach]]

    Type parameters

    • T_1

    • TReturn_1

    • TNext_1

    Parameters

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

          • v: T_1
          • idx: number

          Returns 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, "sync">

    Returns void

  • See [[Enhancements.forEach]]

    Type parameters

    • T_2

    Parameters

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

          • v: T_2
          • idx: number

          Returns 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, "sync">) => void

      • <XReturn, XNext>(gen: Generator<T_2, XReturn, XNext> | Iterator<T_2, XReturn, XNext> | Iterable<T_2> | Enhancements<T_2, XReturn, XNext, "sync">): 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, "sync">

        Returns void

  • See [[Enhancements.forEach]]

    Type parameters

    • T_3

    Parameters

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

          • v: T_3
          • idx: number

          Returns 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, "sync">, thisArg?: any) => 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, "sync">, thisArg?: any): 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, "sync">
        • Optional thisArg: any

        Returns void

Const join

  • join(sep: string): <T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">) => 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, "sync">, sep?: string): 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, "sync">, sep?: string): string | (<X>(gen: Generator<X, TReturn_2, TNext_2> | Iterator<X, TReturn_2, TNext_2> | Iterable<X> | Enhancements<X, TReturn_2, TNext_2, "sync">) => 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, "sync">) => string

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

        • T

        • TReturn

        • TNext

        Parameters

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

        Returns 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, "sync">
    • Optional sep: string

    Returns 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, "sync">
    • Optional sep: string

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

Const limit

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

Const map

  • map<T, V>(f: (v: T, idx: number) => V): GenOpValue<"sync", T, V, []>
  • map<T_1, V_1>(f: (v: T_1, idx: number) => V_1, thisArg?: any): GenOpValue<"sync", T_1, V_1, []>
  • map<T_2, V_2, TReturn, TNext>(f: (v: T_2, idx: number) => V_2, gen: Generator<T_2, TReturn, TNext> | Iterator<T_2, TReturn, TNext> | Iterable<T_2> | Enhancements<T_2, TReturn, TNext, "sync">): EnhancedGenerator<V_2, TReturn, TNext>
  • map<T_3, V_3, TReturn_1, TNext_1>(f: (v: T_3, idx: number) => 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, "sync">): EnhancedGenerator<V_3, TReturn_1, TNext_1>
  • See [[Enhancements.map]]

    Type parameters

    • T

    • V

    Parameters

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

          • v: T
          • idx: number

          Returns V

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

    Returns: Sync.Generator

  • See [[Enhancements.map]]

    Type parameters

    • T_1

    • V_1

    Parameters

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

          • v: T_1
          • idx: number

          Returns V_1

    • Optional thisArg: any

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

    Returns: Sync.Generator

  • See [[Enhancements.map]]

    Type parameters

    • T_2

    • V_2

    • TReturn

    • TNext

    Parameters

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

          • v: T_2
          • idx: number

          Returns V_2

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

    Returns EnhancedGenerator<V_2, TReturn, TNext>

    Returns: Sync.Generator

  • See [[Enhancements.map]]

    Type parameters

    • T_3

    • V_3

    • TReturn_1

    • TNext_1

    Parameters

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

          • v: T_3
          • idx: number

          Returns 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, "sync">

    Returns EnhancedGenerator<V_3, TReturn_1, TNext_1>

    Returns: Sync.Generator

Const merge

  • merge<T, TReturn, TNext>(...sources: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedGenerator<T, void | TReturn, TNext>

Const of

  • of<T, TReturn, TNext>(...values: T): EnhancedGenerator<UnwrapArray<T>, TReturn, TNext>

Const reduce

  • reduce<A, T, TReturn, TNext>(f: (acc: A | T, v: T) => A, gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">): A
  • reduce<A_1, T_1, TReturn_1, TNext_1>(f: (acc: A_1 | T_1, v: T_1) => 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, "sync">) => A_1
  • reduce<A_2, T_2>(f: (acc: A_2, v: T_2) => 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, "sync">) => A_2
  • reduce<A_3, T_3, TReturn_3, TNext_3>(f: (acc: A_3, v: T_3) => 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, "sync">): A_3
  • reduce<A_4, T_4>(f: (acc: A_4, v: T_4) => 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, "sync">) => A_4
  • reduce<A_5, T_5, TReturn_5, TNext_5>(f: (acc: A_5 | T_5, v: T_5) => A_5, initOrGen?: 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, "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, "sync">): A_5 | (A_5 extends PromiseLike<R> ? R : A_5) | (<XReturn, XNext>(gen: Iterable<T_5> | Generator<T_5, XReturn, XNext> | Iterator<T_5, XReturn, XNext> | Enhancements<T_5, XReturn, XNext, "sync">) => A_5 | (A_5 extends PromiseLike<R> ? R : A_5)) | ((f: (acc: A_5, v: T_5) => A_5 | (A_5 extends PromiseLike<R> ? R : A_5), init: A_5) => A_5 | (A_5 extends PromiseLike<R> ? R : A_5)) | ((f: (acc: A_5 | T_5, v: T_5) => A_5 | (A_5 extends PromiseLike<R> ? R : A_5)) => 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
        • (acc: A | T, v: T): A
        • Parameters

          • acc: A | T
          • v: T

          Returns A

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

    Returns 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
        • (acc: A_1 | T_1, v: T_1): A_1
        • Parameters

          • acc: A_1 | T_1
          • v: T_1

          Returns 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, "sync">) => 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, "sync">): 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, "sync">

        Returns A_1

  • See [[Enhancements.reduce]]

    Type parameters

    • A_2

    • T_2

    Parameters

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

          • acc: A_2
          • v: T_2

          Returns 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, "sync">) => 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, "sync">): 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, "sync">

        Returns 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
        • (acc: A_3, v: T_3): A_3
        • Parameters

          • acc: A_3
          • v: T_3

          Returns 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, "sync">

    Returns A_3

  • See [[Enhancements.reduce]]

    Type parameters

    • A_4

    • T_4

    Parameters

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

          • acc: A_4
          • v: T_4

          Returns 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, "sync">) => 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, "sync">): 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, "sync">

        Returns 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
        • (acc: A_5 | T_5, v: T_5): A_5
        • Parameters

          • acc: A_5 | T_5
          • v: T_5

          Returns A_5

    • Optional initOrGen: 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, "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, "sync">

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

Const repeat

  • repeat<T, TReturn, TNext>(value: T, repetitions: number): EnhancedGenerator<T, void | TReturn, TNext>

Const repeatLast

  • repeatLast<T, TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">, max: number): EnhancedGenerator<T, void | TReturn, TNext>

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, "sync">) => EnhancedGenerator<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, "sync">): EnhancedGenerator<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, "sync">): EnhancedGenerator<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, "sync">) => EnhancedGenerator<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, "sync">) => EnhancedGenerator<X, undefined | XReturn, XNext>

    Returns: Sync.Generator

      • <X, XReturn, XNext>(iter: Generator<X, XReturn, XNext> | Iterator<X, XReturn, XNext> | Iterable<X> | Enhancements<X, XReturn, XNext, "sync">): EnhancedGenerator<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, "sync">

        Returns EnhancedGenerator<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, "sync">

    Returns EnhancedGenerator<T, undefined | TReturn, TNext>

    Returns: Sync.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, "sync">

    Returns EnhancedGenerator<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, "sync">) => EnhancedGenerator<X_1, undefined | XReturn_1, XNext_1>)

    Returns: Sync.Generator

Const some

  • some<T>(p: (v: T, idx: number) => boolean, thisArg?: any): <TReturn, TNext>(gen: Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">) => boolean
  • some<T_1>(p: (v: T_1, idx: number) => 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, "sync">, thisArg?: any) => boolean
  • some<T_2, TReturn_2, TNext_2>(p: (v: T_2, idx: number) => 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, "sync">): boolean
  • some<T_3, TReturn_3, TNext_3>(p: (v: T_3, idx: number) => 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, "sync">): boolean
  • some<T_4, TReturn_4, TNext_4>(pred: (v: T_4, idx: number) => 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, "sync">): boolean | (<XReturn, XNext>(gen: Iterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => boolean)
  • See [[Enhancements.some]]

    Type parameters

    • T

    Parameters

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

          • v: T
          • idx: number

          Returns boolean

    • Optional thisArg: any

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

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

        • TReturn

        • TNext

        Parameters

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

        Returns boolean

  • See [[Enhancements.some]]

    Type parameters

    • T_1

    Parameters

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

          • v: T_1
          • idx: number

          Returns 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, "sync">, thisArg?: any) => 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, "sync">, thisArg?: any): 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, "sync">
        • Optional thisArg: any

        Returns boolean

  • See [[Enhancements.some]]

    Type parameters

    • T_2

    • TReturn_2

    • TNext_2

    Parameters

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

          • v: T_2
          • idx: number

          Returns 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, "sync">

    Returns boolean

  • See [[Enhancements.some]]

    Type parameters

    • T_3

    • TReturn_3

    • TNext_3

    Parameters

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

          • v: T_3
          • idx: number

          Returns 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, "sync">

    Returns boolean

  • See [[Enhancements.some]]

    Type parameters

    • T_4

    • TReturn_4 = T_4

    • TNext_4 = T_4

    Parameters

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

          • v: T_4
          • idx: number

          Returns 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, "sync">

    Returns boolean | (<XReturn, XNext>(gen: Iterable<T_4> | Generator<T_4, XReturn, XNext> | Iterator<T_4, XReturn, XNext> | Enhancements<T_4, XReturn, XNext, "sync">) => 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, "sync">)[]) => 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, "sync">)[]) => T[]

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

        • XReturn

        • XNext

        Parameters

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

        Returns T[]

Const wrap

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

    Type parameters

    • T = any

    • PARAMS: any[] = any[]

    Parameters

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

      A function that returns an Iterator<T>

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

          • Rest ...args: PARAMS

          Returns Iterator<T, any, undefined>

    • Rest ...args: PARAMS

      Arguments to be passed to the function

    Returns SyncFunctionWrapper<T, PARAMS>

Const zip

  • zip<T, TReturn, TNext>(...gens: (Generator<T, TReturn, TNext> | Iterator<T, TReturn, TNext> | Iterable<T> | Enhancements<T, TReturn, TNext, "sync">)[]): EnhancedGenerator<T[], TReturn, TNext>

Generated using TypeDoc