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

epidemic-broadcast-trees

Package Overview
Dependencies
Maintainers
1
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 6.2.2 to 6.3.1

19

index.js

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

function createValidate (isFeed) {
return function (clock) {
for(var k in clock) {
if(!isFeed(k)) {
var _clock = {}
for(var k in clock) {
if(isFeed(k)) _clock[k] = clock[k]
}
return _clock
}
}
return clock
}
}
module.exports = function (opts) {

@@ -37,2 +52,6 @@ var state = events.initialize(opts.id, timestamp())

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

@@ -39,0 +58,0 @@ //check if peer exists in state, because we may

2

package.json
{
"name": "epidemic-broadcast-trees",
"description": "",
"version": "6.2.2",
"version": "6.3.1",
"homepage": "https://github.com/dominictarr/epidemic-broadcast-trees",

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

@@ -95,3 +95,4 @@ # epidemic-broadcast-trees

getAt: function ({id:string, sequence:number}, cb),
append: function (msg, cb)
append: function (msg, cb),
isFeed: function (id),
}

@@ -114,2 +115,5 @@ ```

`isFeed(id)` is a validation function that returns true if `id`
is a valid feed identifier. If not, it is ignored'
### ebt.onAppend (msg)

@@ -170,1 +174,4 @@

@@ -34,2 +34,6 @@ var inherits = require('inherits')

EBTStream.prototype._validate = function (clock) {
return clock
}
EBTStream.prototype.write = function (data) {

@@ -42,2 +46,7 @@ if(this.peer.logging) console.error("EBT:recv", JSON.stringify(data, null, 2))

else {
if(data.clock)
data.clock = this._validate(data.clock)
else
data = this._validate(data)
if(this.version === 2) {

@@ -112,2 +121,1 @@ var _data = data; data = {}

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