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.0.6 to 1.0.7

24

lib/log.js

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

const final = _.unionWith(current, others, Node.equals);
this._items = this._items.concat(final);

@@ -55,7 +54,8 @@ this._currentBatch = [];

// Fetch history
const nexts = Lazy(other.items).map((f) => f.next).flatten().toArray();
const nexts = _.flatten(other.items.map((f) => f.next));
Promise.map(nexts, (f) => {
let all = this.items.map((f) => f.hash);
let all = this.items.map((a) => a.hash);
return this._fetchRecursive(this._ipfs, f, all, MaxHistory, 0).then((history) => {
history.reverse().forEach((e) => this._insert(e)) // Insert to the log
history.forEach((b) => this._insert(b));
return history;
});

@@ -101,13 +101,7 @@ }, { concurrency: 1 }).then((r) => resolve(final));

// Process next node
const handle = Lazy(node.next)
.async()
.map((f) => this._fetchRecursive(ipfs, f, all, amount, depth))
.toArray()
handle.onError(reject);
handle.onComplete((array) => {
result = result.concat(array);
Promise.all(result).then((res) => resolve(Lazy(res).flatten().toArray()));
});
Promise.map(node.next, (f) => this._fetchRecursive(ipfs, f, all, amount, depth), { concurrency: 1 })
.then((res) => {
result = _.flatten(res.concat(result));
resolve(result);
});
}).catch(reject);

@@ -114,0 +108,0 @@ });

{
"name": "ipfs-log",
"version": "1.0.6",
"version": "1.0.7",
"description": "Append-only log for IPFS",

@@ -5,0 +5,0 @@ "main": "lib/log.js",

@@ -428,4 +428,4 @@ 'use strict';

assert.equal(items.length, 2);
assert.equal(items[0].hash, 'Qmcpgub1qRG5XHed1qNciwb74uasUhQVEhP35oaZZ7UWbi');
assert.equal(items[1].hash, 'QmRMUN4WJdpYydRLpbipaNoLQNXiw9ifRpPht5APaLFqrR');
assert.equal(items[0].hash, 'QmRMUN4WJdpYydRLpbipaNoLQNXiw9ifRpPht5APaLFqrR');
assert.equal(items[1].hash, 'Qmcpgub1qRG5XHed1qNciwb74uasUhQVEhP35oaZZ7UWbi');
done();

@@ -441,5 +441,5 @@ }));

assert.equal(items.length, 3);
assert.equal(items[2].hash, 'QmRMUN4WJdpYydRLpbipaNoLQNXiw9ifRpPht5APaLFqrR');
assert.equal(items[0].hash, 'QmRMUN4WJdpYydRLpbipaNoLQNXiw9ifRpPht5APaLFqrR');
assert.equal(items[1].hash, 'Qmcpgub1qRG5XHed1qNciwb74uasUhQVEhP35oaZZ7UWbi');
assert.equal(items[0].hash, 'QmQM4Xg6EGGGEKRYu3jX3cpTcXK53XvSgQpxZd2qGY1L2V');
assert.equal(items[2].hash, 'QmQM4Xg6EGGGEKRYu3jX3cpTcXK53XvSgQpxZd2qGY1L2V');
done();

@@ -460,4 +460,4 @@ }));

assert.equal(items.length, amount);
assert.equal(items[0].hash, _.last(nodes).hash);
assert.equal(_.last(items).hash, nodes[0].hash);
assert.equal(items[0].hash, nodes[0].hash);
assert.equal(_.last(items).hash, _.last(nodes).hash);
done();

@@ -474,4 +474,4 @@ }));

assert.equal(items.length, 2);
assert.equal(items[0].hash, 'QmQM4Xg6EGGGEKRYu3jX3cpTcXK53XvSgQpxZd2qGY1L2V');
assert.equal(items[1].hash, 'Qmcpgub1qRG5XHed1qNciwb74uasUhQVEhP35oaZZ7UWbi');
assert.equal(items[0].hash, 'Qmcpgub1qRG5XHed1qNciwb74uasUhQVEhP35oaZZ7UWbi');
assert.equal(items[1].hash, 'QmQM4Xg6EGGGEKRYu3jX3cpTcXK53XvSgQpxZd2qGY1L2V');
done();

@@ -478,0 +478,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