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

Since 0.0.7

Type Parameters

  • T

Implements

  • IterableIterator<T>

Constructors

Methods

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

    WARNING: It closes the current stream

    Parameters

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

      Drop condition

        • (v): boolean
        • Parameters

          Returns boolean

    Returns Stream<T>

    Since 0.0.1

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

    WARNING: It closes the current stream

    Parameters

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

      Condition to check

        • (v): boolean
        • Parameters

          Returns boolean

    Returns boolean

    Since 0.0.1

  • Flat map all elements of the Stream using f

    WARNING: It closes the current stream

    Type Parameters

    • U

    Parameters

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

      Mapper function

        • (v): IterableIterator<U, any, any>
        • Parameters

          Returns IterableIterator<U, any, any>

    Returns Stream<U>

    Since 0.0.1

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

    WARNING: It closes the current stream

    Parameters

    • nth: number

      Position of the element to extract

    Returns null | T

    Since 0.0.12

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

    WARNING: It closes the current stream

    Parameters

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

      Condition to check

        • (v): boolean
        • Parameters

          Returns boolean

    Returns [boolean, null | T]

    Since 0.0.1

  • Join others Stream to the current Stream

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

    Parameters

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

      Streams to join to the current Stream

    Returns Stream<T>

    Since 0.0.1