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) 235 B
/** * Runs different functions based on predicates. * @author @dailker */ export declare function branchByPredicate<T, R>(branches: Array<[(input: T) => boolean, (input: T) => R]>, defaultFn: (input: T) => R): (input: T) => R;