stream-to-pull-stream
Advanced tools
Comparing version 1.2.3 to 1.3.1
31
index.js
@@ -93,23 +93,6 @@ var pull = require('pull-core') | ||
read() | ||
return | ||
;(function next () { | ||
if(ended && ended !== true) //ERROR | ||
return cb(ended) | ||
var data = stream.read() | ||
if(data == null) { | ||
if(ended) | ||
return cb(ended) | ||
_cb = cb | ||
stream.on('readable', next) | ||
} else { | ||
return cb(null, data) | ||
} | ||
})() | ||
} | ||
} | ||
function read(stream) { | ||
if('function' === typeof stream.read) | ||
return read2(stream) | ||
function read1(stream) { | ||
var buffer = [], cbs = [], ended, paused = false | ||
@@ -123,3 +106,3 @@ | ||
paused = false | ||
stream.resume() | ||
stream.resume() | ||
} | ||
@@ -157,2 +140,8 @@ } | ||
function read (stream) { | ||
if('function' === typeof stream.read) | ||
return read2(stream) | ||
return read1(stream) | ||
} | ||
var sink = function (stream) { | ||
@@ -183,1 +172,5 @@ return pull.Sink(function (read) { | ||
exports.source = source | ||
exports.read = read | ||
exports.read1 = read1 | ||
exports.read2 = read2 | ||
{ | ||
"name": "stream-to-pull-stream", | ||
"description": "", | ||
"version": "1.2.3", | ||
"description": "convert a stream1 or streams2 stream into a pull-stream", | ||
"version": "1.3.1", | ||
"homepage": "https://github.com/dominictarr/stream-to-pull-stream", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
9275
288