Skip to main content
Module

x/aitertools/mod.ts

Well-tested utility functions dealing with async iterables
Go to Latest
import * as aitertools from "https://deno.land/x/aitertools@0.5.0/mod.ts";

Classes

An immutable sequence of numbers. It implements both Iterable and AsyncIterable.

Functions

Makes an assertion that the elements of the actual iterable are equal to the elements of the expected array.

Makes an assertion that the beginning elements of the actual iterable are in common with the elements of the expected array.

Concatenates multiple async iterables into one async iterable.

Makes an infinite async iterable of evenly spaced values starting with the start number.

Makes an async iterator that yields elements from the source and saving a copy of each. When the source is exhausted, yields saved copies indefinitely.

Drops a specified number of elements from the beginning of an async iterable, and yields the remaining elements.

Drops a specified number of elements from the end of an async iterable, and yields the remaining elements.

Drops elements from the beginning of an async iterable as long as a specified condition is met, and yields the remaining elements.

Eliminates all elements from the iterable source that do not satisfy the predicate function.

Turns a synchrnous iterable source into an async iterable.

Groups elmenets of an async interable source according to a specified keySelector function and creates a map of each group key to the elements in that group. Key values are compared using the === operator.

Transforms every element of the iterable source into a new iterable.

Creates a Range of numbers from 0 to stop with step 1.

Apply reducer function of two arguments cumulatively to the elements of an async iterable source, from left to right, so as to reduce the async iterable to a single value.

Makes an async iterator that yields the same value over and over again. It will repeat indefinitely unless times is specified.

Takes a specified number of elements from the beginning of an async iterable.

Takes a specified number of elements from the end of an async iterable.

Takes elements from the beginning of an async iterable as long as a specified condition is met. If the condition is not met, the iterable stops.

Creates an array from an async iterable.

Creates a map from an async iterable of key-value pairs. Each pair is represented as an array of two elements.

Creates a set from an async iterable.

Eliminate duplicates in an async iterable source.