MCPcopy Index your code
hub / github.com/nodejs/node / parseChunks

Method parseChunks

lib/internal/debugger/inspect_client.js:279–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277
278 function onResponse(httpRes) {
279 function parseChunks() {
280 const resBody = Buffer.concat(chunks).toString();
281 if (httpRes.statusCode !== 200) {
282 reject(new ERR_DEBUGGER_ERROR(`Unexpected ${httpRes.statusCode}: ${resBody}`));
283 return;
284 }
285 try {
286 resolve(JSONParse(resBody));
287 } catch {
288 reject(new ERR_DEBUGGER_ERROR(`Response didn't contain JSON: ${resBody}`));
289
290 }
291 }
292
293 httpRes.on('error', reject);
294 httpRes.on('data', (chunk) => ArrayPrototypePush(chunks, chunk));

Callers

nothing calls this directly

Calls 4

concatMethod · 0.80
rejectFunction · 0.50
resolveFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected