Determines the number of elements in this stream.
Determines whether all members of the stream satisfy the specified test.
Returns the elements of the stream that meet the condition specified in a callback function. The function is called when the resulting stream elements are actually accessed, so accessing the resulting stream multiple times means the function is also called multiple times for each element of the stream.
Returns the value of the first element in the stream that meets the condition, or undefined
if there is no such element.
Returns the index of the first element in the stream that meets the condition, or -1
if there is no such element.
This method calls predicate
once for each element of the stream, in ascending
order, until it finds one where predicate
returns a value which is coercible to the
Boolean value true
.
Returns a new stream with all sub-stream or sub-array elements concatenated into it recursively up to the specified depth.
Optional
depth: DThe maximum recursion depth. Defaults to 1.
Performs the specified action for each element in the stream.
Function called once for each element in the stream.
Returns the first element in the stream, or undefined
if the stream is empty.
Determines whether the stream includes a certain element, returning true
or false
as appropriate.
The element to search for.
Returns the index of the first occurrence of a value in the stream, or -1 if it is not present.
The value to locate in the array.
The stream index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
Determines whether this stream contains no elements.
Returns an iterator for this stream. This is the same as calling the Symbol.iterator
function property.
Adds all elements of the stream into a string, separated by the specified separator string.
A string used to separate one element of the stream from the next in the resulting string. If omitted, the steam elements are separated with a comma.
Returns a stream that yields the results of calling the specified callback function on each element of the stream. The function is called when the resulting stream elements are actually accessed, so accessing the resulting stream multiple times means the function is also called multiple times for each element of the stream.
Protected
recursiveCalls the specified callback function for all elements in the stream. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Calls the specified callback function for all elements in the stream, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Determines whether any member of the stream satisfies the specified test.
This method calls the predicate function for each element in the stream until the
predicate returns a value which is coercible to the Boolean value true
, or until the end
of the stream.
Collects all elements of this stream into an array.
Collects all elements of this stream into a Set.
Returns a string representation of a stream.
The default implementation of
TreeStream
takes a root element and a function that computes the children of its argument. Whether the root node included in the stream is controlled with theincludeRoot
option, which defaults tofalse
.