UNPKG

sequency

Version:

Functional sequences for processing iterable data in JavaScript

15 lines (14 loc) 527 B
import Sequence from "./Sequence"; export declare class Partition { /** * Evaluates the given `predicate` for each element of the sequence and assorts each element into one of two lists * according to the result of the predicate. Returns both lists as an object. * * @param {(value: T) => boolean} predicate * @returns {{true: Array<T>; false: Array<T>}} */ partition<T>(this: Sequence<T>, predicate: (value: T) => boolean): { "true": Array<T>; "false": Array<T>; }; }