MCPcopy Create free account
hub / github.com/TruthHun/BookStack / onwrite

Function onwrite

static/word2md/mammoth.browser.js:25643–25666  ·  view source on GitHub ↗
(stream, er)

Source from the content-addressed store, hash-verified

25641}
25642
25643function onwrite(stream, er) {
25644 var state = stream._writableState;
25645 var sync = state.sync;
25646 var cb = state.writecb;
25647
25648 onwriteStateUpdate(state);
25649
25650 if (er) onwriteError(stream, state, sync, er, cb);else {
25651 // Check if we're actually ready to finish, but don't emit yet
25652 var finished = needFinish(state);
25653
25654 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
25655 clearBuffer(stream, state);
25656 }
25657
25658 if (sync) {
25659 /*<replacement>*/
25660 asyncWrite(afterWrite, stream, state, finished, cb);
25661 /*</replacement>*/
25662 } else {
25663 afterWrite(stream, state, finished, cb);
25664 }
25665 }
25666}
25667
25668function afterWrite(stream, state, finished, cb) {
25669 if (!finished) onwriteDrain(stream, state);

Callers 1

WritableStateFunction · 0.70

Calls 5

onwriteStateUpdateFunction · 0.70
onwriteErrorFunction · 0.70
needFinishFunction · 0.70
clearBufferFunction · 0.70
afterWriteFunction · 0.70

Tested by

no test coverage detected