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

ipfs-log

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipfs-log - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

3

package.json
{
"name": "ipfs-log",
"version": "1.3.2",
"version": "1.3.3",
"description": "Append-only log for IPFS",

@@ -9,2 +9,3 @@ "main": "src/log.js",

"dependencies": {
"bluebird": "^3.3.5",
"buffer": "^4.5.1",

@@ -11,0 +12,0 @@ "lazy.js": "^0.4.2",

@@ -8,2 +8,3 @@ 'use strict';

const Node = require('./node');
const Promise = require('bluebird');

@@ -20,2 +21,3 @@ const MaxBatchSize = 10; // How many items to keep per local batch

this.options = opts || { maxHistory: MaxHistory };
if(!this.options.maxHistory) this.options.maxHistory = MaxHistory;
this._currentBatch = [];

@@ -57,12 +59,14 @@ this._heads = [];

const nexts = _.flatten(other.items.map((f) => f.next));
const promises = nexts.map((f) => {
return Promise.map(nexts, (f) => {
let all = this.items.map((a) => a.hash);
return this._fetchRecursive(this._ipfs, f, all, this.options.maxHistory, 0)
.then((history) => {
history.forEach((b) => this._insert(b));
this._heads = Log.findHeads(this);
return history;
let h = _.differenceWith(history, this._items, Node.equals);
h.forEach((b) => this._insert(b));
return h;
});
});
return Promise.all(promises).then((r) => _.flatten(r.concat(diff)))
}, { concurrency: 1 }).then((r) => {
this._heads = Log.findHeads(this);
return _.flatten(r).concat(diff)
})
}

@@ -96,2 +100,3 @@

// If the given hash is in the given log (all) or if we're at maximum depth, return

@@ -107,4 +112,4 @@ if(isReferenced(all, hash) || depth >= amount)

const promises = node.next.map((f) => this._fetchRecursive(ipfs, f, all, amount, depth));
return Promise.all(promises).then((res) => _.flatten(res.concat(result)));
return Promise.map(node.next, (f) => this._fetchRecursive(ipfs, f, all, amount, depth), { concurrency: 1 })
.then((res) => _.flatten(res.concat(result)))
});

@@ -111,0 +116,0 @@ }

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