typedash
Version:
modern, type-safe collection of utility functions
19 lines (18 loc) • 884 B
TypeScript
import { t as Maybe } from "./Maybe-pvX1mStM.js";
//#region src/functions/max/max.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 max<T>(array: Maybe<readonly T[]>): number;
/**
* Computes the maximum 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 maximum value in the array, or `undefined` if the array is empty or nil.
*/
declare function max<T>(array: Maybe<readonly T[]>, valueExtractor?: (value: T) => number): number;
//#endregion
export { max as t };
//# sourceMappingURL=max-CPf7oZjM.d.ts.map