understream
Advanced tools
Comparing version 0.4.5 to 0.4.6
// Generated by CoffeeScript 1.6.3 | ||
var ArrayStream, DevNull, Readable, Understream, Writable, construct, debug, domain, fs, _, | ||
var ArrayStream, DevNull, Readable, Understream, Writable, construct, debug, domain, fs, implements_interface, _, | ||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, | ||
@@ -19,2 +19,11 @@ __hasProp = {}.hasOwnProperty, | ||
implements_interface = function(instance, klass) { | ||
if (!_.isObject(instance)) { | ||
return false; | ||
} | ||
return _.all(_.keys(klass.prototype), function(key) { | ||
return key in instance; | ||
}); | ||
}; | ||
construct = function(constructor, args) { | ||
@@ -82,6 +91,8 @@ var F; | ||
this.read_streams = [this.read_stream]; | ||
} else if (this.read_stream instanceof Readable) { | ||
} else if (implements_interface(this.read_stream, Readable)) { | ||
this.read_streams = [this.read_stream]; | ||
} else if (this.read_stream == null) { | ||
this.read_streams = []; | ||
} else { | ||
throw new Error('Understream expects a readable stream, an array, or nothing'); | ||
} | ||
@@ -152,3 +163,3 @@ } | ||
if (name == null) { | ||
name = ReadableStreamKlass.name; | ||
name = Readable.name; | ||
} | ||
@@ -155,0 +166,0 @@ if (fn == null) { |
{ | ||
"name": "understream", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "stream helpers", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72513
830