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

Function readJsonNumber

src/daemon/network-log.ts:329–339  ·  view source on GitHub ↗
(value: Record<string, unknown> | null, keys: string[])

Source from the content-addressed store, hash-verified

327}
328
329function readJsonNumber(value: Record<string, unknown> | null, keys: string[]): number | null {
330 if (!value) return null;
331 for (const key of keys) {
332 const next = value[key];
333 if (typeof next === 'number' && Number.isInteger(next)) return next;
334 if (typeof next === 'string' && /^\d{3}$/.test(next.trim())) {
335 return Number.parseInt(next.trim(), 10);
336 }
337 }
338 return null;
339}
340
341function readHeaders(line: string, json: Record<string, unknown> | null): string | undefined {
342 if (json) {

Callers 1

parseNetworkLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…