Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pull-stream

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-stream - npm Package Compare versions

Comparing version 2.13.0 to 2.14.0

test/flatten.js

2

package.json
{
"name": "pull-stream",
"description": "minimal pull stream",
"version": "2.13.0",
"version": "2.14.0",
"homepage": "https://github.com/dominictarr/pull-stream",

@@ -6,0 +6,0 @@ "repository": {

var u = require('./util')
var sources = require('./sources')
var prop = u.prop

@@ -144,3 +145,29 @@ var id = u.id

var flatten = exports.flatten = function (read) {
var chunk
var _read
return function (abort, cb) {
if(_read) nextChunk()
else nextStream()
function nextChunk () {
_read(null, function (end, data) {
if(end) nextStream()
else cb(null, data)
})
}
function nextStream () {
read(null, function (end, stream) {
if(end)
return cb(end)
if(Array.isArray(stream))
stream = sources.values(stream)
else if('function' != typeof stream)
throw new Error('expected stream of streams')
_read = stream
nextChunk()
})
}
}
/* var chunk
return function (end, cb) {

@@ -160,3 +187,3 @@ //this means that the upstream is sending an error.

})
}
}*/
}

@@ -163,0 +190,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc