Skip to main content
Module

x/ahh/src/iterator.ts

Opinionated idiomatic features for TypeScript.
Go to Latest
import * as ahh from "https://deno.land/x/ahh@v0.12.1/src/iterator.ts";

Contains an idiomatic Iterator type and related functions.

Unlike the Iterator type built into JavaScript, this Iterator is lazy. This is useful as it means items are only evaluated once you call Iterator.next on the Iterator, not up-front.

Since Iterators use the iteration protocols, we still have access to features built into the language, such as:

Classes

See Iterator.chain.

See empty.

See Iterator.enumerate.

See Iterator.filter.

See fn.

See iter.

c
Iterator
abstract

An interface for types that can be iterated over.

See Iterator.map.

See once.

See Iterator.peekable.

See repeat.

See Iterator.skip.

See Iterator.skipWhile.

See Iterator.take.

See Iterator.takeWhile.

See Iterator.zip.

Functions

Creates an Iterator that yields nothing.

Creates an Iterator that calls fn each iteration.

Creates an Iterator that yields items from an Iterable.

Creates an Iterator that yields exactly one item.

Creates an Iterator that endlessly yields an item.

Creates an Iterator where each successive item is computed from the previous one.