mafintosh / tar-stream

tar-stream is a streaming tar parser and generator.
MIT License
406 stars 92 forks source link

Trigger an error if there is an incomplete entry at the end of stream #83

Closed sth closed 6 years ago

sth commented 6 years ago

This is a pull request that fixes #82.

It keeps track if there is an entry currently being parsed, and triggers an error if that's still the case when _final() is called.

_final() was introduced in node v8, but since tar-stream uses stream-readable instead of the standard library streams, it works for all node versions.

mafintosh commented 6 years ago

Node version should not matter as we use the readable-stream module.

mafintosh commented 6 years ago

Ah you said that already 😁

sth commented 6 years ago

I removed the extra arg, it didn't really make things clearer.

mafintosh commented 6 years ago

Out in 1.6.0 with a few minor tweaks :)