Function nextValue

  • Returns the next value of an iterator, or throws NoValueToGet if the iterator is done.

    Type Parameters

    • Iter extends AnyIterator<V>
    • V = AnyIteratorV<Iter>

    Parameters

    Returns Iter extends Iterator<unknown>
        ? V
        : Promise<V>

    Example

    // Returns 1
    it.nextValue(it.iterator([1, 2, 3]))

    Example

    // Throws NoValueToGet
    it.nextValue(it.iterator([]))

    Throws

    NoValueToGet