teambition / merge2

Merge multiple streams into one stream in sequence or parallel (~119M/month downloads).
MIT License
170 stars 14 forks source link

Fix 'TypeError: Invalid non-string/buffer chunk' when using classic style streams #11

Closed romank8k closed 7 years ago

romank8k commented 7 years ago

Hi, I discovered an issue when using classic style streams. The options, which should include objectMode: true are not defined when creating the PassThrough stream for compatibility with the old style streams. Therefore, if the old style stream emits anything other than a string/Buffer, this Exception will be thrown:

TypeError: Invalid non-string/buffer chunk

Added a test to reproduce and a fix.

Thanks!

zensh commented 7 years ago

Thank you. v1.0.3 released.