dominictarr/stream-combiner — pull request #5 by substack (2014-05-09 01:38:04+00:00)
Title: pass through when arguments.length == 0

Presently if you do `combine()` with no arguments, you get an exception:

```
> require('./')()
TypeError: Cannot call method 'on' of undefined
at proxyStream (/home/substack/projects/stream-combiner/node_modules/duplexer/index.js:65:16)
at Array.forEach (native)
at forEach (/home/substack/projects/stream-combiner/node_modules/duplexer/index.js:11:20)
at duplex (/home/substack/projects/stream-combiner/node_modules/duplexer/index.js:27:5)
at module.exports (/home/substack/projects/stream-combiner/index.js:8:17)
at repl:1:15
at REPLServer.self.eval (repl.js:110:21)
at Interface. (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
```

There is a check later in the code to test for the arguments.length == 0 case, but duplexer() is being called before that happens with an undefined argument, which throws.

This patch allows the 0-argument case to be a valid input and returns a pass-through stream since I use this module often with arrays of streams and it's annoying to test for the empty case explicitly. An example is browserify transforms, which may have 0 or many transform streams in an array based on dynamic conditions.