@monstermann/fn
Version:
A utility library for TypeScript.
20 lines • 433 B
TypeScript
//#region src/array/minOr.d.ts
/**
* `minOr(array, fallback)`
*
* Returns the minimum value in the number `array`, or `fallback` if the array is empty.
*
* ```ts
* minOr([5, 1, 3, 2], 0); // 1
* ```
*
* ```ts
* pipe([5, 1, 3, 2], minOr(0)); // 1
* ```
*/
declare const minOr: {
<T>(or: T): (target: readonly number[]) => number | T;
<T>(target: readonly number[], or: T): number | T;
};
//#endregion
export { minOr };