pump
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -54,5 +54,9 @@ var once = require('once'); | ||
var functionish = function(fn) { | ||
return !fn || typeof fn === 'function'; | ||
}; | ||
var pump = function() { | ||
var streams = Array.prototype.slice.call(arguments); | ||
var callback = typeof streams[streams.length-1] === 'function' ? streams.pop() : noop; | ||
var callback = functionish(streams[streams.length-1]) && streams.pop() || noop; | ||
@@ -59,0 +63,0 @@ if (Array.isArray(streams[0])) streams = streams[0]; |
{ | ||
"name": "pump", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"repository": "git://github.com/mafintosh/pump.git", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -30,3 +30,3 @@ # pump | ||
setTimeout(function() { | ||
dest.destroy(); // when dest is closes pump will destroy source | ||
dest.destroy(); // when dest is closed pump will destroy source | ||
}, 1000); | ||
@@ -33,0 +33,0 @@ ``` |
4082
93