Function skipUntil

  • Skips values until the predicate test succeeds. The value for which predicate succeeds is not skipped.

    import {pipe, skipUntil} from 'iter-ops';

    const i = pipe(
    [1, 2, 3, 4, 5, 6, 7, 8, 9],
    skipUntil(a => a > 5) // skip until value > 5
    );

    console.log(...i); //=> 6, 7, 8, 9

    Note that the predicate can only return a Promise inside an asynchronous pipeline, or else the Promise will be treated as a truthy value.

    Type Parameters

    • T

    Parameters

    • cb: ((value, index, state) => boolean | Promise<boolean>)
        • (value, index, state): boolean | Promise<boolean>
        • Parameters

          Returns boolean | Promise<boolean>

    Returns Operation<T, T>