MCPcopy
hub / github.com/omkarcloud/botasaurus / get

Method get

js/botasaurus-js/src/cache.ts:157–176  ·  view source on GitHub ↗
(func: Function | string, keyData: any, raiseException = true)

Source from the content-addressed store, hash-verified

155 }
156
157 static get(func: Function | string, keyData: any, raiseException = true): any {
158 if (Array.isArray(keyData)) {
159 return Cache.getItems(func, keyData);
160 }
161
162 _createCacheDirectoryIfNotExists(func);
163 const path = _getCachePath(func, keyData);
164 if (_has(path)) {
165 try {
166 return _get(path);
167 } catch (error) {
168 return null;
169 }
170 }
171
172 if (raiseException) {
173 throw new CacheMissException(path);
174 }
175 return null;
176 }
177
178 static getItems(func: Function | string, items?: any[]): any[] {
179 if (typeof items === 'string') {

Callers 3

task.jsFile · 0.45
saveImageFunction · 0.45
deleteItemsByFilterMethod · 0.45

Calls 5

_getCachePathFunction · 0.85
getItemsMethod · 0.80
_hasFunction · 0.70
_getFunction · 0.70

Tested by

no test coverage detected