MCPcopy
hub / github.com/BrainJS/brain.js / callFinal

Function callFinal

browser.js:25459–25469  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

25457 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
25458}
25459function callFinal(stream, state) {
25460 stream._final(function (err) {
25461 state.pendingcb--;
25462 if (err) {
25463 stream.emit('error', err);
25464 }
25465 state.prefinished = true;
25466 stream.emit('prefinish');
25467 finishMaybe(stream, state);
25468 });
25469}
25470function prefinish(stream, state) {
25471 if (!state.prefinished && !state.finalCalled) {
25472 if (typeof stream._final === 'function') {

Callers

nothing calls this directly

Calls 1

finishMaybeFunction · 0.70

Tested by

no test coverage detected