Commit 85c84215 authored by Tristan Cavelier's avatar Tristan Cavelier

getRevisionFromPosition method add to revisionstorage.js

parent e751f5ff
......@@ -345,6 +345,23 @@ jIO.addStorageType('revision', function (spec, my) {
return revisions;
};
/**
* Returns the revision of the revision position from a revs_info array.
* @method getRevisionFromPosition
* @param {array} revs_info The revs_info array
* @param {number} rev_pos The revision position number
* @return {string} The revision of the good position (empty string if fail)
*/
priv.getRevisionFromPosition = function (revs_info, rev_pos) {
var i;
for (i = revs_info.length - 1; i >= 0; i -= 1) {
if (priv.revisionToArray(revs_info.rev)[0] === rev_pos) {
return revs_info.rev;
}
}
return '';
};
/**
* Post the document metadata and create or update a document tree.
* Options:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment