MCPcopy
hub / github.com/chartjs/Chart.js / isNumber

Function isNumber

src/helpers/helpers.math.ts:67–69  ·  view source on GitHub ↗
(n: unknown)

Source from the content-addressed store, hash-verified

65}
66
67export function isNumber(n: unknown): n is number {
68 return !isNonPrimitive(n) && !isNaN(parseFloat(n as string)) && isFinite(n as number);
69}
70
71export function almostWhole(x: number, epsilon: number) {
72 const rounded = Math.round(x);

Callers 5

updateElementsMethod · 0.85
updateElementsMethod · 0.85
hasValueMethod · 0.85
parseFunction · 0.85
_generateMethod · 0.85

Calls 1

isNonPrimitiveFunction · 0.85

Tested by

no test coverage detected