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

Function decodeDoc

lib/index-browser.js:4758–4767  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

4756// read the doc back out from the database. we don't store the
4757// _id or _rev because we already have _doc_id_rev.
4758function decodeDoc(doc) {
4759 if (!doc) {
4760 return doc;
4761 }
4762 var idx = doc._doc_id_rev.lastIndexOf(':');
4763 doc._id = doc._doc_id_rev.substring(0, idx - 1);
4764 doc._rev = doc._doc_id_rev.substring(idx + 1);
4765 delete doc._doc_id_rev;
4766 return doc;
4767}
4768
4769// Read a blob from the database, encoding as necessary
4770// and translating from base64 if the IDB doesn't support

Callers 4

fetchDocAsynchronouslyFunction · 0.70
onBatchFunction · 0.70
onGetMetadataFunction · 0.70
initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…