Options
All
  • Public
  • Public/Protected
  • All
Menu

Class IterableExtensions

Contains static methods which expose iterable helpers. These methods can be found in aureooms/js-itertools - https://aureooms.github.io/js-itertools/.

The functions were adapted to fit needs, including adding generics support for tooling assistance.

Hierarchy

  • IterableExtensions

Index

Methods

Static Combinations

  • Combinations<T>(iterable: T[], size: number): IterableIterator<T[]>
  • Generator function to return combinations of an iterable object Intended for use in for..of loops.

    Type parameters

    • T

    Parameters

    • iterable: T[]

      object array to produce combinations of

    • size: number

      returns combination results of specified size

    Returns IterableIterator<T[]>

Static Pick

  • Pick<T>(object: T[], keys: any): Generator<T, void, unknown>
  • Generator function to yield objects in list. Intended for use in for..of loops.

    Type parameters

    • T

    Parameters

    • object: T[]

      object to pick from

    • keys: any

      indexes of the object

    Returns Generator<T, void, unknown>

Static Range

  • Range(start: number, stop: number, step: number): Generator<number, void, unknown>
  • Create an iterable range of numbers Intended for use in for..of loops.

    Parameters

    • start: number

      First number returned from iterated range

    • stop: number

      Will stop before this number

    • step: number

      Steps between start and stop

    Returns Generator<number, void, unknown>

Generated using TypeDoc