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

Function finishImpl

lib/internal/streams/pipeline.js:229–251  ·  view source on GitHub ↗
(err, final)

Source from the content-addressed store, hash-verified

227 }
228
229 function finishImpl(err, final) {
230 if (err && (!error || error.code === 'ERR_STREAM_PREMATURE_CLOSE' || error.name === 'AbortError')) {
231 error = err;
232 }
233
234 if (!error && !final) {
235 return;
236 }
237
238 while (destroys.length) {
239 destroys.shift()(error);
240 }
241
242 disposable?.[SymbolDispose]();
243 ac.abort();
244
245 if (final) {
246 if (!error) {
247 lastStreamCleanup.forEach((fn) => fn());
248 }
249 process.nextTick(callback, error, value);
250 }
251 }
252
253 let ret;
254 for (let i = 0; i < streams.length; i++) {

Callers 3

abortFunction · 0.85
finishFunction · 0.85
finishOnlyHandleErrorFunction · 0.85

Calls 4

abortMethod · 0.65
forEachMethod · 0.65
fnFunction · 0.50
shiftMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…