UNPKG

sequency

Version:

Functional sequences for processing iterable data in JavaScript

12 lines (11 loc) 357 B
import Sequence from "./Sequence"; export declare class First { /** * Returns the first element of the sequence or the first element matching `predicate` if present, otherwise throws * an error. * * @param {(T) => boolean} predicate * @returns {T} */ first<T>(this: Sequence<T>, predicate?: (item: T) => boolean): T; }