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

epidemic-broadcast-trees

Package Overview
Dependencies
Maintainers
19
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epidemic-broadcast-trees - npm Package Compare versions

Comparing version 8.0.4 to 8.0.5

19

index.js

@@ -9,18 +9,2 @@ var events = require('./events')(require('./v3'))

// Returns a function that removes keys from `clock` where `!isFeed(key)`.
function createValidate (isFeed) {
return function (clock) {
for(var outerKey in clock) {
if(!isFeed(outerKey)) {
var _clock = {}
for(var innerKey in clock) {
if(isFeed(innerKey)) _clock[innerKey] = clock[innerKey]
}
return _clock
}
}
return clock
}
}
module.exports = function (opts) {

@@ -67,5 +51,2 @@ var state = events.initialize(opts.id, opts.getMsgAuthor, opts.getMsgSequence)

if(opts.isFeed)
stream._validate = createValidate(opts.isFeed)
opts.getClock(remote_id, function (err, clock) {

@@ -72,0 +53,0 @@ //check if peer exists in state, because we may

2

package.json
{
"name": "epidemic-broadcast-trees",
"description": "bandwidth efficient broadcast gossip",
"version": "8.0.4",
"version": "8.0.5",
"homepage": "https://github.com/dominictarr/epidemic-broadcast-trees",

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

@@ -97,19 +97,3 @@ var createPeer = require('../')

var bs2 = bob.createStream('alice', 2, true)
var as2 = alice.createStream('bob', 2, false)
as2.pipe(bs2).pipe(as2)
bob.append({author: 'bob', sequence: 2, content: 'hello2'}, function () {})
t.throws(function () {
as.write({alice: -1, bob: -2})
})
t.equal(as.ended, true)
t.equal(bs.ended, true)
t.deepEqual(alice.store, bob.store)
t.end()
})

@@ -133,4 +117,4 @@

var bs3 = bob.createStream('alice', 3, false)
var bs2 = bob.createStream('charles', 2, false)
var cs2 = charles.createStream('bob', 2, true)
var bs2 = bob.createStream('charles', 3, false)
var cs2 = charles.createStream('bob', 3, true)

@@ -137,0 +121,0 @@ console.log('initial.alice:',alice.progress())

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