MCPcopy Create free account
hub / github.com/callstack/agent-device / requiredNumber

Function requiredNumber

src/commands/command-input.ts:375–381  ·  view source on GitHub ↗
(record: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

373}
374
375export function requiredNumber(record: Record<string, unknown>, key: string): number {
376 const value = record[key];
377 if (typeof value !== 'number' || !Number.isFinite(value)) {
378 throw new Error(`Expected ${key} to be a finite number.`);
379 }
380 return value;
381}
382
383function optionalNumberValue(record: Record<string, unknown>, key: string): number | undefined {
384 const value = record[key];

Callers 3

readGestureInputFunction · 0.90
readInteractionTargetFunction · 0.85
readPointFunction · 0.85

Calls 1

isFiniteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…