Socket
Socket
Sign inDemoInstall

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.2 to 1.0.3

3

lib/log.js

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

return Lazy(log.items)
.reverse()
.filter((f) => !Log.isReferencedInChain(log, f))

@@ -190,3 +191,3 @@ .toArray();

static isReferencedInChain(log, item) {
return Lazy(log.items).find((e) => e.hasChild(item)) !== undefined;
return Lazy(log.items).reverse().find((e) => e.hasChild(item)) !== undefined;
}

@@ -193,0 +194,0 @@

{
"name": "ipfs-log",
"version": "1.0.2",
"version": "1.0.3",
"description": "Append-only log for IPFS",

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

@@ -1,50 +0,50 @@

'use strict';
// 'use strict';
const _ = require('lodash');
const assert = require('assert');
const async = require('asyncawait/async');
const await = require('asyncawait/await');
const ipfsd = require('ipfsd-ctl');
const Log = require('../lib/log');
const Node = require('../lib/node');
// const _ = require('lodash');
// const assert = require('assert');
// const async = require('asyncawait/async');
// const await = require('asyncawait/await');
// const ipfsd = require('ipfsd-ctl');
// const Log = require('../lib/log');
// const Node = require('../lib/node');
let ipfs;
// let ipfs;
const startIpfs = () => {
return new Promise((resolve, reject) => {
ipfsd.disposableApi((err, ipfs) => resolve(ipfs));
});
};
// const startIpfs = () => {
// return new Promise((resolve, reject) => {
// ipfsd.disposableApi((err, ipfs) => resolve(ipfs));
// });
// };
describe('ipfs-log - Performance Measurement', async(function() {
this.timeout(60000);
before(async((done) => {
try {
ipfs = await(startIpfs());
} catch(e) {
console.log(e);
assert.equal(e, null);
}
done();
}));
// describe('ipfs-log - Performance Measurement', async(function() {
// this.timeout(60000);
// before(async((done) => {
// try {
// ipfs = await(startIpfs());
// } catch(e) {
// console.log(e);
// assert.equal(e, null);
// }
// done();
// }));
it.only('add', async((done) => {
let ms = 0;
// it.only('add', async((done) => {
// let ms = 0;
for(let t = 100; t <= 1000; t += 300) {
const log = await(Log.create(ipfs, 'A'));
const startTime = new Date().getTime();
// for(let t = 100; t <= 1000; t += 300) {
// const log = await(Log.create(ipfs, 'A'));
// const startTime = new Date().getTime();
for(let i = 0; i < t; i ++) {
await(log.add("hello" + i));
}
// for(let i = 0; i < t; i ++) {
// await(log.add("hello" + i));
// }
const endTime = new Date().getTime();
console.log(` > ${t} took ${(endTime - startTime)} ms`)
}
// const endTime = new Date().getTime();
// console.log(` > ${t} took ${(endTime - startTime)} ms`)
// }
assert.equal(true, true);
done();
}));
// assert.equal(true, true);
// done();
// }));
}));
// }));
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