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

Function _getCachePath

js/botasaurus-js/src/cache.ts:25–32  ·  view source on GitHub ↗
(func: Function | string, data: any)

Source from the content-addressed store, hash-verified

23}
24
25function _getCachePath(func: Function | string, data: any): string {
26 const fnName = getFnName(func);
27
28 const serializedData = JSON.stringify(data);
29 const dataHash = crypto.createHash('md5').update(serializedData).digest('hex');
30 const cachePath = path.join(Cache.cacheDirectory, fnName, `${dataHash}.json`);
31 return cachePath;
32}
33
34function _hash(data: any): string {
35 const serializedData = JSON.stringify(data);

Callers 6

runTaskFunction · 0.90
runPlaywrightFunction · 0.90
putMethod · 0.85
hasMethod · 0.85
getMethod · 0.85
deleteMethod · 0.85

Calls 2

getFnNameFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected