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

Function readHeaders

src/daemon/network-log.ts:341–348  ·  view source on GitHub ↗
(line: string, json: Record<string, unknown> | null)

Source from the content-addressed store, hash-verified

339}
340
341function readHeaders(line: string, json: Record<string, unknown> | null): string | undefined {
342 if (json) {
343 const headers = json.headers ?? json.requestHeaders ?? json.responseHeaders;
344 if (headers !== undefined) return stringifyValue(headers);
345 }
346 const match = /\bheaders?["'=: ]+(\{.*\})/i.exec(line);
347 return match?.[1]?.trim();
348}
349
350function readBody(
351 line: string,

Callers 1

parseNetworkLineFunction · 0.85

Calls 1

stringifyValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…