UNPKG

typedash

Version:

modern, type-safe collection of utility functions

19 lines (18 loc) 945 B
import { t as Maybe } from "./Maybe-BVpZiDsE.cjs"; //#region src/functions/min/min.d.ts /** * Computes the maximum value of array. If array is empty or nil, `undefined` is returned. * @param array The array to iterate over. * @returns The maximum value in the array, or `undefined` if the array is empty or nil. */ declare function min(array: Maybe<readonly number[]>): number; /** * Computes the minimum value of array. If array is empty or nil, `undefined` is returned. * @param array The array to iterate over. * @param valueExtractor An optional function used to extract a numeric value from each element. * @returns The element with the minimum value in the array according to the `valueExtractor`, or `undefined` if the array is empty or nil. */ declare function min<T>(array: Maybe<readonly T[]>, valueExtractor: (value: T) => number): T | undefined; //#endregion export { min as t }; //# sourceMappingURL=min-DVYEK6Oj.d.cts.map