Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -882,7 +882,7 @@ function HttpPouch(opts, callback) { | |
// Given a set of document/revision IDs (given by req), tets the subset of | ||
// those that do NOT correspond to revisions stored in the database. | ||
// See http://wiki.apache.org/couchdb/HttpPostRevsDiff | ||
api.revsDiff = utils.adapterFun('revsDif', function (req, opts, callback) { | ||
api.revsDiff = utils.adapterFun('revsDiff', function (req, opts, callback) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
// If no options were given, set the callback to be the second parameter | ||
if (typeof opts === 'function') { | ||
callback = opts; | ||
|
@@ -894,10 +894,8 @@ function HttpPouch(opts, callback) { | |
headers: host.headers, | ||
method: 'POST', | ||
url: genDBUrl(host, '_revs_diff'), | ||
body: req | ||
}, function (err, res) { | ||
callback(err, res); | ||
}); | ||
body: JSON.stringify(req) | ||
This comment has been minimized.
Sorry, something went wrong.
nolanlawson
Author
Member
|
||
}, callback); | ||
}); | ||
|
||
api._close = function (callback) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ LazyMap.prototype.mangle = function (key) { | |
} | ||
return '$' + key; | ||
}; | ||
LazyMap.prototype.unmangle = function (key) { | ||
return key.substring(1); | ||
}; | ||
LazyMap.prototype.get = function (key) { | ||
var mangled = this.mangle(key); | ||
if (mangled in this.store) { | ||
|
@@ -36,6 +39,23 @@ LazyMap.prototype.delete = function (key) { | |
} | ||
return false; | ||
}; | ||
LazyMap.prototype.entries = function () { | ||
var self = this; | ||
var i = 0; | ||
var keys = Object.keys(self.store).sort(); | ||
return { | ||
next: function () { | ||
var key = keys[i++]; | ||
if (typeof key === 'undefined') { | ||
return; | ||
} else { | ||
var value = self.store[key]; | ||
return [self.unmangle(key), value]; | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
nolanlawson
Author
Member
|
||
function LazySet() { | ||
this.store = new LazyMap(); | ||
} | ||
|
Don't know how this managed to slip through, but I'm guessing the typo was causing this method to never get hit.