Skip to main content
Module

x/rambda/immutable.d.ts>partition

Faster and smaller alternative to Ramda
Go to Latest
function partition
import { partition } from "https://deno.land/x/rambda@v7.0.1/immutable.d.ts";

It will return array of two objects/arrays according to predicate function. The first member holds all instances of input that pass the predicate function, while the second member - those who doesn't.

Parameters

predicate: Predicate<T>
input: readonly T[]

Returns

readonly [readonly T[], readonly T[]]

Parameters

predicate: Predicate<T>

Returns

(input: readonly T[]) => readonly [readonly T[], readonly T[]]

Parameters

predicate: (x: T, prop?: string) => boolean
input: { readonly [key: string]: T; }

Returns

readonly [{ readonly [key: string]: T; }, { readonly [key: string]: T; }]

Parameters

predicate: (x: T, prop?: string) => boolean

Returns

(input: { readonly [key: string]: T; }) => readonly [{ readonly [key: string]: T; }, { readonly [key: string]: T; }]