Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

takeUntil

import { takeUntil } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/iterable.ts";

Take elements from an Iterable until a predicate is satisfied. The element that satisfies the predicate is not included.

@example
import * as I from "./iterable.ts";

const numbers = I.wrap(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
const untilFive = I.takeUntil((n: number) => n === 5)(numbers);

const result = Array.from(untilFive); // [1, 2, 3, 4]
function takeUntil<A>(predicate: Predicate<A>): (ta: Iterable<A>) => Iterable<A>;
§
takeUntil<A>(predicate: Predicate<A>): (ta: Iterable<A>) => Iterable<A>
[src]

§Type Parameters

§Parameters

§
predicate: Predicate<A>
[src]

§Return Type

§
(ta: Iterable<A>) => Iterable<A>
[src]