Socket
Socket
Sign inDemoInstall

sorted-union-stream

Package Overview
Dependencies
4
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.1 to 3.2.2

42

index.js

@@ -16,3 +16,3 @@ const { Readable } = require('streamx')

this._onclose = null
this._both = opts && opts.both
this._both = !!(opts && opts.both)
this._map = (opts && opts.map) || defaultMap

@@ -41,11 +41,10 @@

}
if (l === null) {
this._mapAndPush(null, r)
this.right.consume()
return cb(null)
this._push(null, r, cb)
return
}
if (r === null) {
this._mapAndPush(l, null)
this.left.consume()
return cb(null)
this._push(l, null, cb)
return
}

@@ -56,22 +55,21 @@

if (cmp === 0) {
this._mapAndPush(l, r)
if (this._both) this._mapAndPush(l, r)
this.left.consume()
this.right.consume()
return cb(null)
this._push(l, r, cb)
return
}
if (cmp < 0) {
this._mapAndPush(l, null)
this.left.consume()
return cb(null)
}
this._mapAndPush(null, r)
this.right.consume()
cb(null)
if (cmp < 0) this._push(l, null, cb)
else this._push(null, r, cb)
}
_mapAndPush (l, r) {
_push (l, r, cb) {
const data = this._map(l, r)
if (data !== null) this.push(data)
const pushed = this.push(data)
if (this._both && l && r) this.push(data)
if (l !== null) this.left.consume()
if (r !== null) this.right.consume()
if (pushed) cb(null)
else this._read(cb)
}

@@ -78,0 +76,0 @@

{
"name": "sorted-union-stream",
"version": "3.2.1",
"version": "3.2.2",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc