MCPcopy
hub / github.com/sunnylqm/react-native-storage / _lookUpInMap

Method _lookUpInMap

storage.js:257–270  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

255 return Promise.resolve(ret.rawData);
256 }
257 _lookUpInMap(params) {
258 let m = this._m,
259 ret;
260 let { key, id } = params;
261 let newId = this._getId(key, id);
262 if(this.enableCache && this.cache[newId]) {
263 ret = this.cache[newId];
264 return this._loadMapItem( {ret, ...params } );
265 }
266 if(m[newId] !== undefined) {
267 return this.getItem('map_' + m[newId]).then( ret => this._loadMapItem( {ret, ...params } ) );
268 }
269 return this._noItemFound( {ret, ...params } );
270 }
271 remove(params) {
272 return this._mapPromise.then(() => {
273 let m = this._m;

Callers 1

loadMethod · 0.95

Calls 4

_getIdMethod · 0.95
_loadMapItemMethod · 0.95
getItemMethod · 0.95
_noItemFoundMethod · 0.95

Tested by

no test coverage detected