Comparing version 2.0.6 to 2.0.7
15
index.js
@@ -136,3 +136,3 @@ var raf = require('random-access-file') | ||
Multifeed.prototype.feeds = function () { | ||
return Object.values(this._feeds) | ||
return values(this._feeds) | ||
} | ||
@@ -174,3 +174,3 @@ | ||
filtered.forEach(function (key) { | ||
var feeds = Object.values(self._feeds).filter(function (feed) { | ||
var feeds = values(self._feeds).filter(function (feed) { | ||
return feed.key.toString('hex') === key | ||
@@ -205,4 +205,4 @@ }) | ||
firstWrite = false | ||
debug('[REPLICATION] able to share ' + Object.values(self._feeds).length + ' keys') | ||
var keys = Object.values(self._feeds).map(function (feed) { return feed.key.toString('hex') }) | ||
debug('[REPLICATION] able to share ' + values(self._feeds).length + ' keys') | ||
var keys = values(self._feeds).map(function (feed) { return feed.key.toString('hex') }) | ||
var headerBuf = serializeHeader(PROTOCOL_VERSION, keys) | ||
@@ -271,3 +271,3 @@ this.push(headerBuf) | ||
function startSync () { | ||
var sortedFeeds = Object.values(self._feeds).sort(cmp) | ||
var sortedFeeds = values(self._feeds).sort(cmp) | ||
function cmp (a, b) { | ||
@@ -354,1 +354,6 @@ return a.key.toString('hex') > b.key.toString('hex') | ||
} | ||
function values (obj) { | ||
return Object.keys(obj).map(function (k) { return obj[k] }) | ||
} | ||
@@ -5,3 +5,3 @@ { | ||
"author": "Stephen Whitmore <sww@eight.net>", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "url": "git://github.com/noffle/multifeed.git" |
25318
9
668