MCPcopy
hub / github.com/di-sukharev/opencommit / handleReply

Function handleReply

out/cli.cjs:57331–57346  ·  view source on GitHub ↗
(mockDispatches, _data = data)

Source from the content-addressed store, hash-verified

57329 }
57330 if (typeof delay3 === "number" && delay3 > 0) {
57331 setTimeout(() => {
57332 handleReply(this[kDispatches]);
57333 }, delay3);
57334 } else {
57335 handleReply(this[kDispatches]);
57336 }
57337 function handleReply(mockDispatches, _data = data) {
57338 const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers;
57339 const body = typeof _data === "function" ? _data({ ...opts, headers: optsHeaders }) : _data;
57340 if (isPromise(body)) {
57341 body.then((newData) => handleReply(mockDispatches, newData));
57342 return;
57343 }
57344 const responseData = getResponseData(body);
57345 const responseHeaders = generateKeyValues(headers);
57346 const responseTrailers = generateKeyValues(trailers);
57347 handler.abort = nop;
57348 handler.onHeaders(statusCode, responseHeaders, resume2, getStatusText(statusCode));
57349 handler.onData(Buffer.from(responseData));

Callers 1

mockDispatchFunction · 0.85

Calls 10

buildHeadersFromArrayFunction · 0.85
getResponseDataFunction · 0.85
generateKeyValuesFunction · 0.85
getStatusTextFunction · 0.85
deleteMockDispatchFunction · 0.85
thenMethod · 0.80
onHeadersMethod · 0.45
onDataMethod · 0.45
fromMethod · 0.45
onCompleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…