Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/iter/lib/transformers.ts>flat

A bunch of utilities for working with iterables, many inspired by the native array methods.
Latest
function flat
import { flat } from "https://deno.land/x/iter@v3.2.3/lib/transformers.ts";

Lazily flattens a nested iterable to a given depth. Similar to Array.prototype.flat

Type Parameters

T
Iter extends Iterable<NestedIterableContent<T>>

Parameters

iter: Iter
  • The iterable to be flattened.
optional
depth = [UNSUPPORTED]
  • The depth to which iter should be flattened.

Returns

IterableCircular<NestedIterableContent<T>>

The flattened iterable.