Skip to main content

Seq<T> Object

The Seq<T> object is the core object; it is created by the Generator and is also the argument and return value of the Operator.

The Seq<T> object has the following methods

methodDescription
pipeTakes an arbitrary number of Operators as arguments and converts the sequence.
toTake one To and convert it into a sequence with different characteristics.
valueTakes only one Value and converts the sequence to a value.
forEachPerforms iterative processing on elements of a sequence.
toArrayConverts a sequence to an readonly array.(Type of the return value is readonly T[]. The only difference from toMutableArray() is the return type.)
toMutableArrayConverts a sequence to an array. (Type of the return value is T[]. The only difference from toArray() is the return type.)

Because it is a lazy list, it does not execute processing when pipe() is called, but only when value(), toArray()**, or forEach()** is called.

AsyncSeq<T> Object

It can be created by passing asyncSeq() to to() of Seq<T> or by using Async Generators. Basically the same as Seq<T>, but valueAsync(), toArrayAsync(), and foreachAsync() are async function. Also, only an asynchronous version of Operators/to/Values, which is passed to pipe()/to()/valueAsync(), is allowed.

methodDescription
pipeTakes an arbitrary number of Operators as arguments and converts the sequence.
toTake one To and convert it into a sequence with different characteristics.
valueAsyncTakes only one Value and converts the sequence to a value.
forEachAsyncPerforms iterative processing on elements of a sequence.
toArrayAsyncConverts a sequence to an readonly array. (Type of the return value is Promise<readonly T[]>. The only difference from toMutableArrayAsync() is the return type.)
toMutableArrayAsyncConverts a sequence to an array. (Type of the return value is Promise<T[]>. The only difference from toArrayAsync() is the return type.)