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

reduplexer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reduplexer - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

index.js

@@ -147,3 +147,3 @@ /*

if (this._writable)
this._callWrite(chunk, enc, cb)
return this._callWrite(chunk, enc, cb)

@@ -150,0 +150,0 @@ // we are in delayed open

{
"name": "reduplexer",
"version": "1.0.0",
"version": "1.1.0",
"description": "Another Stream2 duplexer",

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

@@ -66,2 +66,21 @@

test('finish event after end', function(t) {
t.plan(2)
var writable = new stream.PassThrough()
, instance
instance = duplexer(writable, writable)
instance.on('data', function(chunk) {
t.equal(chunk.toString(), 'a message')
})
instance.on('finish', function() {
t.ok(true, 'finish happened')
})
instance.end('a message')
})
test('objectMode', function(t) {

@@ -238,2 +257,20 @@ t.plan(1)

test('supports highWaterMark: 2', function(t) {
var writable = new stream.Transform({ objectMode: true, highWaterMark: 2 })
, instance
, unlock = null
writable._transform = function(obj, enc, cb) {
unlock = cb
}
instance = duplexer(writable, writable, { objectMode: true, highWaterMark: 2 })
t.ok(writable.write('hello'), 'after first we can write')
t.notOk(writable.write('hello'), 'after second we cannot write more')
t.end()
})
if (process.browser) {

@@ -240,0 +277,0 @@ return

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