MCPcopy Index your code
hub / github.com/monkeytypegame/monkeytype / isSafeNumber

Function isSafeNumber

packages/util/src/numbers.ts:139–144  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

137 * @returns True if the value is a safe number, false otherwise.
138 */
139export function isSafeNumber(value: unknown): value is number {
140 if (typeof value === "number") {
141 return !isNaN(value) && isFinite(value);
142 }
143 return false;
144}
145
146/**
147 * Converts a number to a safe number or undefined. NaN, Infinity, and -Infinity are converted to undefined.

Callers 15

runBreakdownFunction · 0.90
handleBeforeShowFunction · 0.90
submitFunction · 0.90
formatStreakFunction · 0.90
formatPbFunction · 0.90
extraStreakTextFunction · 0.90
getRatingAverageFunction · 0.90
logTestEventFunction · 0.90
getAllTestEventsFunction · 0.90
showFunction · 0.90
updateParticleFunction · 0.90
renderFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected