import { Lazy } from "https://deno.land/x/lazy@v1.7.3/lib/lazy.ts";
The base class that all lazy iterable objects derive from. This can be extended with custom iterators if needed.
Methods
Returns whether all elements satisfy the given condition.
Returns whether any of the elements satisfy the given condition.
Applies the given lazy iterable implementation to the current object. This allows for using custom Lazy implementations using the standard chaining syntax.
Determines whether the iterable has a given element.
Returns the number of elements that satify the given condition.
Returns the elements in the iterable, or the given default value as the only element if it contained none.
Returns the element at the given index of the iterable, or the given default value if out of range.
Returns the element at the given index of the iterable, or the given default value if out of range.
Returns the set difference between 2 iterables. This like doing an XOR over the 2 iterables.
Returns the first element that satisfies the given condition.
Returns the first element in the iterable, or the given default value if the iterable was empty.
Returns the first element in the iterable, or the given default value if the iterable was empty.
Returns the first element in the iterable that satisfies the condition, or the given default value.
Returns the first element in the iterable that satisfies the condition, or the given default value.
Mimics the behaviour of Array.prototype.forEach
, with the exception
of not providing the entire array as the 3rd param of the callback.
Groups the elements by key and projects each element using the given function.
Groups the elements by key and projects each element using the given function. The elements of each group are projected using the given function.
Joins 2 iterables on the given key and groups the results.
Returns the set intersection between 2 iterables. This like doing an AND over the 2 iterables.
Determines whether 2 iterables are equal.
Joins 2 iterables on the given matching keys. This is similar to a JOIN in SQL.
Returns the last element in the iterable that satisfies the given condition.
Returns the last element in the iterable, or the given default value if the iterable was empty.
Returns the last element in the iterable, or the given default value if the iterable was empty.
Returns the last element in the iterable that satisfies the given condition, or the given default value.
Returns the last element in the iterable that satisfies the given condition, or the given default value.
Sorts the iterable in acending order according to the numeric result of the key function.
Sorts the iterable in descending order according to the numeric result of the key function.
Resolves all of the promises in the iterable, and returns a new Lazy iterable from the result.
Projects the elements of the iterable into a new form.
Projects the elements of the iterable into a new form, and flattens the iterable of iterables into a single iterable.
Returns a single element from the iterable that matches the given condition.
Returns a single element from the iterable that matches the given condition, or a default value if no element was found.
Returns a single element from the iterable that matches the given condition, or a default value if no element was found.
Skips all elements in the iterable until the condition returns true, after which all elements are returned regardless.
Joins all the elements in the iterable together into a single string, split by the given separator.
Takes all elements in the iterable until the condition returns true, after which the iterable is considered to have ended.
Converts the iterable into a map using the key and value function.
Returns the set union between 2 iterables. This like doing an OR over the 2 iterables.
Filters elements based on the given predicate.
Filters elements based on the given predicate.
Combines 2 iterables into an iterable of tuples. This will merge elements on the same index, finishing on the iterable that finishes first. If the first iterable has 3 elements, and the second 4, then the result will have 3 elements.
Combines 2 iterables using the given selector. This will merge elements on the same index, finishing on the iterable that finishes first. If the first iterable has 3 elements, and the second 4, then the result will have 3 elements.