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) 241 B
/** * Creates a function that runs one of two paths based on a predicate. * @author @dailker */ export declare function ifElse<T, R>(predicate: (input: T) => boolean, ifFn: (input: T) => R, elseFn: (input: T) => R): (input: T) => R;