MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / numericField

Function numericField

packages/cli/src/auth/oauth.ts:374–382  ·  view source on GitHub ↗
(obj: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

372}
373
374function numericField(obj: Record<string, unknown>, key: string): number | undefined {
375 const v = obj[key];
376 if (typeof v === "number" && Number.isFinite(v)) return v;
377 if (typeof v === "string") {
378 const n = Number.parseFloat(v);
379 return Number.isFinite(n) ? n : undefined;
380 }
381 return undefined;
382}
383
384/**
385 * Persist a new OAuth token set, always preserving a co-located

Callers 1

parseTokenResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected