partition (Functional Programming) es-toolkit
Creates a function that splits values into passing and failing groups. Use it with pipe.
Info
Usage
partition returns a pair of arrays. The first array contains values for which predicate returns true, and the second contains the rest.
Parameters
predicate(value: T) => booleanrequired
The function that decides which group each value belongs to.
Returns
A function that maps a readonly T[] to passing and failing arrays.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.