MCPcopy Index your code
hub / github.com/apache/pouchdb / get

Method get

lib/index.js:4872–4896  ·  view source on GitHub ↗
(store, key, callback)

Source from the content-addressed store, hash-verified

4870 }
4871
4872 get(store, key, callback) {
4873 var cache = getCacheFor(this, store);
4874 var exists = cache.get(key);
4875 if (exists) {
4876 return nextTick(function () {
4877 callback(null, exists);
4878 });
4879 } else if (exists === null) { // deleted marker
4880 /* istanbul ignore next */
4881 return nextTick(function () {
4882 callback({name: 'NotFoundError'});
4883 });
4884 }
4885 store.get(key, function (err, res$$1) {
4886 if (err) {
4887 /* istanbul ignore else */
4888 if (err.name === 'NotFoundError') {
4889 cache.set(key, null);
4890 }
4891 return callback(err);
4892 }
4893 cache.set(key, res$$1);
4894 callback(null, res$$1);
4895 });
4896 }
4897
4898 batch(batch) {
4899 for (var i = 0, len = batch.length; i < len; i++) {

Callers 1

LevelPouchFunction · 0.95

Calls 2

getCacheForFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected