MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / readJson

Function readJson

packages/core/src/utils/envelope.ts:155–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

153 }
154
155 function readJson<T>(): T {
156 let i = buffer.indexOf(0xa);
157 // If we couldn't find a newline, we must have found the end of the buffer
158 if (i < 0) {
159 i = buffer.length;
160 }
161
162 return JSON.parse(decodeUTF8(readBinary(i))) as T;
163 }
164
165 const envelopeHeader = readJson<BaseEnvelopeHeaders>();
166 // eslint-disable-next-line @typescript-eslint/no-explicit-any

Callers 1

parseEnvelopeFunction · 0.70

Calls 2

decodeUTF8Function · 0.85
readBinaryFunction · 0.85

Tested by

no test coverage detected