concat-stream icon indicating copy to clipboard operation
concat-stream copied to clipboard

New encoding auto-detection + streams2 change problem case

Open brycebaril opened this issue 11 years ago • 0 comments

I'm not sure this is a big deal, but the encoding inference can cause issues when using objectMode streams and not specifying that the encoding is objects to concat-stream.

I found this in one of my tests when I updated this dependency:

var spigot = require("stream-spigot")
var concat = require("concat-stream")

spigot({objectMode: true}, [1, 2, 3, 4, 5])
  .pipe(concat(function (c) { console.log(c) }))

// <Buffer 31 32 33 34 35>

Using {encoding: "object"} fixes this, but where people may be relying on the auto-detection (e.g. legacy concat-stream invocations) they could end up in trouble.

brycebaril avatar Jan 10 '14 18:01 brycebaril