diff --git a/index.js b/index.js index f369a29..97b506c 100644 --- a/index.js +++ b/index.js @@ -38,7 +38,8 @@ export default class FileType extends Transform { _flush (cb) { if (this[kStream] != null) { - this[kStream].end(() => cb(null)) + this[kStream].on('close', () => cb(null)) + this[kStream].destroy() } else { cb(null) }