Skip to main content
Module

x/asynciter/filter.ts>filter

Map, filter, reduce for AsyncIterables in Deno.
Latest
function filter
import { filter } from "https://deno.land/x/asynciter@0.0.18/filter.ts";

Filter the sequence to contain just the items that pass a test.

Parameters

iterable: AsyncIterable<T>

An iterable collection.

filterFn: (item: T) => boolean | Promise<boolean>

The filter function; true to keep the item, false to discard.

Returns

AsyncIterableIterator<T>

An iterator returning the values that pass the filter function.