New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hypercore-protocol-substream

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hypercore-protocol-substream - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6

18

index.js

@@ -29,4 +29,6 @@ const _debug = require('debug')

this._onDestroyed = this._onDestroyed.bind(this)
this._onUnpipe = this._onUnpipe.bind(this)
this.feed.once('close', this._onDestroyed)
this.feed.on('extension', this._onExtension)
this.feed.stream.on('unpipe', this._onUnpipe)
}

@@ -40,2 +42,6 @@

delSub (sub) {
if (sub.state === INIT || sub.state === ESTABLISHED) {
console.warn('Warn: mainstream closed while substream was initializing or active')
sub._transition(CLOSING)
}
if (typeof sub.rid !== 'undefined') {

@@ -48,2 +54,9 @@ delete this._ridTable[sub.rid]

// Forward unpipe events to active substreams
_onUnpipe (src) {
this.subs.forEach(s => {
if (s) s.emit('unpipe', src)
})
}
_onDestroyed () {

@@ -82,2 +95,5 @@ this.feed.off('extension', this._onExtension)

transmit (buffer) {
if (!this.feed.stream.writable) {
return console.warn('Substream trying to write to non writable stream')
}
this.feed.extension(EXTENSION, buffer)

@@ -245,3 +261,3 @@ }

assert(feed.stream)
assert(!feed.stream.destroyed, 'Can\'t initalize substream on an already destroyed stream')
if (typeof name === 'string') name = Buffer.from(name)

@@ -248,0 +264,0 @@ assert(Buffer.isBuffer(name), '"namespace" must be a String or a Buffer')

2

package.json
{
"name": "hypercore-protocol-substream",
"version": "2.0.5",
"version": "2.0.6",
"description": "Create independent virtual streams on a hypercore-protocol stream",

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

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