MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / max

Function max

packages/common/src/math.ts:29–33  ·  view source on GitHub ↗
(arr: (number | null | undefined)[])

Source from the content-addressed store, hash-verified

27};
28
29export const max = (arr: (number | null | undefined)[]): number => {
30 const filtered = arr.filter(isNumber);
31 if (filtered.length === 0) return 0;
32 return filtered.reduce((a, b) => (b > a ? b : a), filtered[0]!);
33};
34
35export const isFloat = (n: number) => n % 1 !== 0;
36

Callers 2

formatFunction · 0.90
CohortTableFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected