orbit-db-feedstore
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "orbit-db-feedstore", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Feed store for orbit-db", | ||
@@ -12,5 +12,4 @@ "main": "src/FeedStore.js", | ||
"dependencies": { | ||
"lazy.js": "^0.4.2", | ||
"orbit-db-eventstore": "0.1.1" | ||
"orbit-db-eventstore": "0.1.3" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
'use strict'; | ||
'use strict' | ||
const EventIndex = require('orbit-db-eventstore/src/EventIndex'); | ||
const EventIndex = require('orbit-db-eventstore/src/EventIndex') | ||
@@ -8,15 +8,15 @@ class FeedIndex extends EventIndex { | ||
added.reduce((handled, item) => { | ||
if(handled.indexOf(item.hash) === -1) { | ||
handled.push(item.hash); | ||
if(!handled.includes(item.hash)) { | ||
handled.push(item.hash) | ||
if(item.payload.op === 'ADD') { | ||
this._index[item.hash] = item | ||
} else if(item.payload.op === 'DEL') { | ||
delete this._index[item.payload.value]; | ||
delete this._index[item.payload.value] | ||
} | ||
} | ||
return handled; | ||
}, []); | ||
return handled | ||
}, []) | ||
} | ||
} | ||
module.exports = FeedIndex; | ||
module.exports = FeedIndex |
@@ -1,11 +0,10 @@ | ||
'use strict'; | ||
'use strict' | ||
const Lazy = require('lazy.js'); | ||
const EventStore = require('orbit-db-eventstore'); | ||
const FeedIndex = require('./FeedIndex'); | ||
const EventStore = require('orbit-db-eventstore') | ||
const FeedIndex = require('./FeedIndex') | ||
class FeedStore extends EventStore { | ||
constructor(ipfs, id, dbname, options) { | ||
if(!options) options = {}; | ||
if(!options.Index) Object.assign(options, { Index: FeedIndex }); | ||
if(!options) options = {} | ||
if(!options.Index) Object.assign(options, { Index: FeedIndex }) | ||
super(ipfs, id, dbname, options) | ||
@@ -22,7 +21,7 @@ } | ||
} | ||
}; | ||
return this._addOperation(operation); | ||
} | ||
return this._addOperation(operation) | ||
} | ||
} | ||
module.exports = FeedStore; | ||
module.exports = FeedStore |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
2479
40
+ Addedlodash.findindex@4.6.0(transitive)
+ Addedlodash.slice@4.2.0(transitive)
+ Addedorbit-db-eventstore@0.1.3(transitive)
+ Addedorbit-db-store@0.1.4(transitive)
- Removedlazy.js@^0.4.2
- Removedlazy.js@0.4.3(transitive)
- Removedorbit-db-eventstore@0.1.1(transitive)
- Removedorbit-db-store@0.1.3(transitive)
Updatedorbit-db-eventstore@0.1.3