Wrapper around IterableIterator interface offering a set of helpers to deal with iterations in a simple way

Remarks

Since 0.0.7

Type Parameters

  • T

Hierarchy

  • Stream

Implements

  • IterableIterator<T>

Constructors

Properties

g: IterableIterator<T>

Underlying data of the Stream

Methods

  • Drop elements from the Stream while f(element) === true

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Parameters

    • f: ((v: T) => boolean)

      Drop condition

        • (v: T): boolean
        • Parameters

          • v: T

          Returns boolean

    Returns Stream<T>

  • Check whether all elements of the Stream are successful for f

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Parameters

    • f: ((v: T) => boolean)

      Condition to check

        • (v: T): boolean
        • Parameters

          • v: T

          Returns boolean

    Returns boolean

  • Filter elements of the Stream

    WARNING: It closes the current stream

    Remarks

    Since 1.23.0

    Type Parameters

    • U

    Parameters

    • f: ((v: T) => v is U)

      Elements to keep

        • (v: T): v is U
        • Parameters

          • v: T

          Returns v is U

    Returns Stream<U>

  • Filter elements of the Stream

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Parameters

    • f: ((v: T) => boolean)

      Elements to keep

        • (v: T): boolean
        • Parameters

          • v: T

          Returns boolean

    Returns Stream<T>

  • Flat map all elements of the Stream using f

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Type Parameters

    • U

    Parameters

    • f: ((v: T) => IterableIterator<U>)

      Mapper function

        • (v: T): IterableIterator<U>
        • Parameters

          • v: T

          Returns IterableIterator<U>

    Returns Stream<U>

  • Take the nth element of the Stream of the last (if it does not exist)

    WARNING: It closes the current stream

    Remarks

    Since 0.0.12

    Parameters

    • nth: number

      Position of the element to extract

    Returns null | T

  • Check whether one of the elements of the Stream is successful for f

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Parameters

    • f: ((v: T) => boolean)

      Condition to check

        • (v: T): boolean
        • Parameters

          • v: T

          Returns boolean

    Returns [boolean, null | T]

  • Join others Stream to the current Stream

    WARNING: It closes the current stream and the other ones (as soon as it iterates over them)

    Remarks

    Since 0.0.1

    Parameters

    • Rest ...others: IterableIterator<T>[]

      Streams to join to the current Stream

    Returns Stream<T>

  • Map all elements of the Stream using f

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Type Parameters

    • U

    Parameters

    • f: ((v: T) => U)

      Mapper function

        • (v: T): U
        • Parameters

          • v: T

          Returns U

    Returns Stream<U>

  • Take elements from the Stream while f(element) === true

    WARNING: It closes the current stream

    Remarks

    Since 0.0.1

    Parameters

    • f: ((v: T) => boolean)

      Take condition

        • (v: T): boolean
        • Parameters

          • v: T

          Returns boolean

    Returns Stream<T>

Generated using TypeDoc