UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

6 lines (5 loc) 264 B
/** * Runs the first function where its predicate passes, like functional if/else if. * @author @dailker */ export declare function chainConditions<T, R>(pairs: Array<[(input: T) => boolean, (input: T) => R]>, defaultFn: (input: T) => R): (input: T) => R;