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

duplexify

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duplexify - npm Package Compare versions

Comparing version 3.5.1 to 3.5.2

15

index.js

@@ -15,3 +15,3 @@ var stream = require('readable-stream')

return function(err) {
if (err) self.destroy(err.message === 'premature close' ? null : err)
if (err) self._destroyInterval(err)
else if (end && !self._ended) self.end()

@@ -50,2 +50,4 @@ }

this._ended = false
this._error = null
this._preferError = false

@@ -172,2 +174,4 @@ this.destroyed = false

Duplexify.prototype.destroy = function(err) {
if (this._preferError && !this._error && err) this._error = err
if (this.destroyed) return

@@ -178,6 +182,13 @@ this.destroyed = true

process.nextTick(function() {
self._destroy(err)
self._destroy(self._preferError ? self._error : err)
})
}
Duplexify.prototype._destroyInterval = function(err) {
if (this.destroyed) return
if (err.message !== 'premature close') return this.destroy(err)
this._forwardError = true
this.destroy(null)
}
Duplexify.prototype._destroy = function(err) {

@@ -184,0 +195,0 @@ if (err) {

2

package.json
{
"name": "duplexify",
"version": "3.5.1",
"version": "3.5.2",
"description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -49,3 +49,3 @@ # duplexify

If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event.
You can also explictly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an
You can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an
error object as argument, in which case the error is emitted as part of the `error` event.

@@ -52,0 +52,0 @@

@@ -263,3 +263,2 @@ var tape = require('tape')

var dup = duplexify(passthrough, passthrough)
var ok = false

@@ -266,0 +265,0 @@ passthrough.emit('close')

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