Abstract
Applies a sequence projection on each element of this
sequence and concatenates the
resulting sequences.
The sequence projection to apply to each element.
A new sequence with the flattened results.
Calls a side-effect function after all elements have been yielded, but before iteration finishes.
⚠️ If the client stops iterating early, the action won't be executed.
A function to invoke after iteration completes.
A new sequence that acts like this
but invokes action
before it's finished.
🦥Lazily gets the element at the given index in this
sequence, or undefined if the
index is out of bounds.
ℹ️ Negative indexes count from the end of the sequence.
⚠️ Requires iterating over the sequence up to the given index.
The index of the item to retrieve.
A 🦥Doddle that resolves to the item at the given index.
Handles errors thrown while iterating over this
sequence.
A handler that will be called with the error and the index of the element that
caused it. Should return a new sequence or undefined
, which stops iteration.
A new sequence that handles errors.
Returns a new sequence. When iterated, before yielding its first element, it will iterate
over all the elements of this
and store them in memory. Then it will yield all of them one
by one.
ℹ️ Used to control side-effects. Makes sure all side-effects execute before continuing to apply other operators.
A new sequence with the same elements as this one, but where iteration has already completed.
Applies a sequence projection on each element of this
sequence and concatenates the
resulting sequences.
The sequence projection to apply to each element.
A new sequence with the flattened results.
Calls an action function as each element in this
is iterated over. Calls the function
before or after yielding the element, or both.
The action function to invoke for each element.
The stage at which to invoke the function. Can be "before"
, "after"
, or
"both"
.
A new sequence that invokes the action function while being iterated.
Groups the elements of this
sequence by key, resulting in a sequence of pairs where the
first element is the key and the second is a sequence of values.
A sequence of pairs.
Returns a cartesian product of this
sequence with one or more other sequences, optionally
applying an N-ary projection to each combination of elements.
The product of N
sequences is the collection of all possible sets of elements from each
sequence.
For example, the product of [1, 2]
and [3, 4]
is:
;[
[1, 3],
[1, 4],
[2, 3],
[2, 4]
]
A new sequence.
🦥Lazily checks if this
sequence contains the same elements as the input sequence,
without regard to order.
ℹ️ The elements are compared by key, using the given key projection.
A 🦥Doddle that resolves to true
if this
is set-equal to the input, or
false
otherwise.
Skips elements from this
sequence while the given predicate is true, and yields the rest.
ℹ️ You can use the options
argument to skip the first element that returns false
.
The predicate to determine whether to continue skipping.
Optional
options: { skipFinal?: boolean }Options for skipping behavior.
Optional
skipFinal?: booleanWhether to skip the boundary element for which the predicate returns false
.
A new sequence without the skipped elements.
Yields the first elements of this
sequence while the given predicate is true and skips the
rest.
ℹ️ If the sequence is too small, the result will be empty.
ℹ️ The options
argument lets you keep the first element for which the predicate returns
false
.
A new sequence with the yielded elements.
Filters out duplicate elements from this
sequence, optionally using a key projection.
ℹ️ Doesn't need to iterate over the entire sequence.
⚠️ Needs to cache the sequence as it's iterated over.
A function that takes an element and returns a key used to check for uniqueness.
A sequence of unique elements.
Zips this
sequence with other sequences, yielding tuples of elements that appear in the
same position in each sequence.
ℹ️ Sequences that are exhausted will yield undefined
for their elements.
ℹ️ The resulting sequence will be as long as the longest input sequence.
A new async sequence of tuples containing parallel elements.
Zips this
sequence with other sequences, applying a projection to each set of elements and
yielding the results.
ℹ️ Sequences that are exhausted will yield undefined
for their elements.
ℹ️ The resulting sequence will be as long as the longest input sequence.
A new sequence of elements generated from the zipped values.
The Seq class, which wraps a synchronous iterable.