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

Function ifNaN

packages/common/src/math.ts:37–40  ·  view source on GitHub ↗
(
  n: number | null | undefined,
  defaultValue: T,
)

Source from the content-addressed store, hash-verified

35export const isFloat = (n: number) => n % 1 !== 0;
36
37export const ifNaN = <T extends number>(
38 n: number | null | undefined,
39 defaultValue: T,
40): T => (Number.isNaN(n) ? defaultValue : (n as T));

Callers 1

getFunnelMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected