Module

x/rambda/immutable.d.ts>splitWhen

Faster and smaller alternative to Ramda
Go to Latest
function splitWhen
import { splitWhen } from "https://dotland.deno.dev/x/rambda@v9.2.0/immutable.d.ts";

It splits list to two arrays according to a predicate function.

The first array contains all members of list before predicate returns true.

Parameters

predicate: Predicate<T>
list: readonly U[]

Returns

readonly ((readonly U[]))[]

Parameters

predicate: Predicate<T>

Returns

<U>(list: readonly U[]) => readonly ((readonly U[]))[]