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

Function onEofChunk

static/word2md/mammoth.browser.js:24556–24569  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

24554}
24555
24556function onEofChunk(stream, state) {
24557 if (state.ended) return;
24558 if (state.decoder) {
24559 var chunk = state.decoder.end();
24560 if (chunk && chunk.length) {
24561 state.buffer.push(chunk);
24562 state.length += state.objectMode ? 1 : chunk.length;
24563 }
24564 }
24565 state.ended = true;
24566
24567 // emit 'readable' now to make sure it gets picked up.
24568 emitReadable(stream);
24569}
24570
24571// Don't emit readable right away in sync mode, because this can trigger
24572// another read() call => stack overflow. This way, it might trigger

Callers 1

readableAddChunkFunction · 0.70

Calls 1

emitReadableFunction · 0.70

Tested by

no test coverage detected