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

Function finishMaybe

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

Source from the content-addressed store, hash-verified

25481}
25482
25483function finishMaybe(stream, state) {
25484 var need = needFinish(state);
25485 if (need) {
25486 prefinish(stream, state);
25487 if (state.pendingcb === 0) {
25488 state.finished = true;
25489 stream.emit('finish');
25490 }
25491 }
25492 return need;
25493}
25494
25495function endWritable(stream, state, cb) {
25496 state.ending = true;

Callers 4

onwriteErrorFunction · 0.70
afterWriteFunction · 0.70
callFinalFunction · 0.70
endWritableFunction · 0.70

Calls 2

needFinishFunction · 0.70
prefinishFunction · 0.70

Tested by

no test coverage detected