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

orbit-db-eventstore

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orbit-db-eventstore - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

4

package.json
{
"name": "orbit-db-eventstore",
"version": "0.0.4",
"version": "0.0.5",
"description": "Eventlog for orbit-db",

@@ -12,4 +12,4 @@ "main": "src/EventStore.js",

"dependencies": {
"orbit-db-store": "0.0.3"
"orbit-db-store": "0.0.4"
}
}

@@ -9,3 +9,3 @@ 'use strict';

constructor(ipfs, id, dbname, options) {
if(!options) Object.assign({}, { Index: EventIndex });
if(!options) options = {};
if(!options.Index) Object.assign(options, { Index: EventIndex });

@@ -16,3 +16,3 @@ super(ipfs, id, dbname, options)

add(data) {
const operation = {
const event = {
op: 'ADD',

@@ -25,3 +25,3 @@ key: null,

};
return this._addOperation(operation);
return this._addOperation(event);
}

@@ -54,3 +54,3 @@

const amount = opts.limit ? (opts.limit > -1 ? opts.limit : this._index.get().length) : 1; // Return 1 if no limit is provided
const operations = this._index.get();
const events = this._index.get();
let result = [];

@@ -60,6 +60,6 @@

// Greater than case
result = this._read(operations, opts.gt ? opts.gt : opts.gte, amount, opts.gte ? true : false)
result = this._read(events, opts.gt ? opts.gt : opts.gte, amount, opts.gte ? true : false)
} else {
// Lower than and lastN case, search latest first by reversing the sequence
result = this._read(operations.reverse(), opts.lt ? opts.lt : opts.lte, amount, opts.lte || !opts.lt).reverse()
result = this._read(events.reverse(), opts.lt ? opts.lt : opts.lte, amount, opts.lte || !opts.lt).reverse()
}

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