Mirror: A Node.js fetch shim using built-in Request, Response, and Headers (but without native fetch)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Premature callback in `InflateStream` before flush (#25)

authored by

Phil Pluckthun and committed by
GitHub
8ee7ffee b2085f98

+8 -1
+5
.changeset/tender-planes-brush.md
··· 1 + --- 2 + 'fetch-nodeshim': patch 3 + --- 4 + 5 + Fix `_final` on `InflateStream` calling `callback` before full flush.
+3 -1
src/encoding.ts
··· 37 37 38 38 _final(callback: TransformCallback) { 39 39 if (this._inflate) { 40 + this._inflate.once('finish', callback); 40 41 this._inflate.end(); 41 42 this._inflate = undefined; 43 + } else { 44 + callback(); 42 45 } 43 - callback(); 44 46 } 45 47 } 46 48