MCPcopy Create free account
hub / github.com/apache/pouchdb / tryAndPut

Function tryAndPut

lib/index-browser.js:755–768  ·  view source on GitHub ↗
(db, doc, diffFun)

Source from the content-addressed store, hash-verified

753}
754
755function tryAndPut(db, doc, diffFun) {
756 return db.put(doc).then(function (res) {
757 return {
758 updated: true,
759 rev: res.rev
760 };
761 }, function (err) {
762 /* istanbul ignore next */
763 if (err.status !== 409) {
764 throw err;
765 }
766 return upsert(db, doc._id, diffFun);
767 });
768}
769
770var thisAtob = function (str) {
771 return atob(str);

Callers 1

upsertFunction · 0.70

Calls 1

upsertFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…