This commit is contained in:
Nolan Lawson 2015-03-22 08:53:44 -04:00
parent 6d66509ab8
commit e346230938
4 changed files with 6 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{
"name": "pouchdb-quick-search",
"version": "1.0.2",
"version": "1.1.0",
"description": "PouchDB Quick Search - persisted full-text search for PouchDB",
"main": "dist/pouchdb.quick-search.js",
"homepage": "https://github.com/nolanlawson/pouchdb-quick-search",

View File

@ -4493,21 +4493,12 @@ function upsertInner(db, docId, diffFun) {
}
doc = {};
}
// the user might change the _rev, so save it for posterity
var docRev = doc._rev;
var newDoc = diffFun(doc);
if (!newDoc) {
// if the diffFun returns falsy, we short-circuit as
// an optimization
return fulfill({updated: false, rev: docRev});
return fulfill({updated: false, rev: doc._rev});
}
// users aren't allowed to modify these values,
// so reset them here
newDoc._id = docId;
newDoc._rev = docRev;
newDoc._rev = doc._rev;
fulfill(tryAndPut(db, newDoc, diffFun));
});
});

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "pouchdb-quick-search",
"version": "1.0.2",
"version": "1.1.0",
"description": "PouchDB Quick Search - persisted full-text search for PouchDB",
"main": "index.js",
"repository": {