cabal-core
Advanced tools
Comparing version 4.0.0 to 4.0.1
10
index.js
@@ -41,4 +41,7 @@ var kappa = require('kappa-core') | ||
this.maxFeeds = opts.maxFeeds | ||
this.key = key || null | ||
this.db = kappa(storage, { valueEncoding: json }) | ||
this.db = kappa(storage, { | ||
valueEncoding: json | ||
}) | ||
@@ -159,3 +162,6 @@ // Create (if needed) and open local write feed | ||
Cabal.prototype.replicate = function () { | ||
return this.db.replicate({ live: true }) | ||
return this.db.replicate({ | ||
live: true, | ||
maxFeeds: this.maxFeeds | ||
}) | ||
} | ||
@@ -162,0 +168,0 @@ |
{ | ||
"name": "cabal-core", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": " p2p db functions for chat ", | ||
@@ -40,3 +40,3 @@ "main": "index.js", | ||
"inherits": "^2.0.3", | ||
"kappa-core": "^2.3.0", | ||
"kappa-core": "^2.7.0", | ||
"kappa-view-level": "^1.1.0", | ||
@@ -43,0 +43,0 @@ "memdb": "^1.3.1", |
@@ -44,2 +44,12 @@ var View = require('kappa-view-level') | ||
api: { | ||
/** | ||
* Creates a read stream of messages | ||
* @param {Object} core - HyperCore to stream messages from. | ||
* @param {String} channel - Name of channel | ||
* @param {Object} opts : | ||
* `gt` {Number} - Filter by timestamp where message.timestamp is greater than `gt` | ||
* `lt` {Number} - Filter by timestamp where message.timestamp is lesser than `lt` | ||
* Supports all levelup.createValueStream() options as well: | ||
* `reverse` {Boolean} - Streams messages in Ascending time order, default: `true` (Descending) | ||
*/ | ||
read: function (core, channel, opts) { | ||
@@ -56,5 +66,3 @@ opts = opts || {} | ||
this.ready(function () { | ||
var v = lvl.createValueStream(xtend(opts, { | ||
reverse: true | ||
})) | ||
var v = lvl.createValueStream(xtend({reverse: true}, opts)) | ||
v.pipe(t) | ||
@@ -61,0 +69,0 @@ }) |
@@ -35,5 +35,3 @@ var View = require('kappa-view-level') | ||
lvl.get('channel!topic!' + channel, (err, topic) => { | ||
if (!err && topic) { | ||
cb(null, topic) | ||
} | ||
cb(err, topic) | ||
}) | ||
@@ -40,0 +38,0 @@ }) |
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
56940
592
Updatedkappa-core@^2.7.0