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

Function _createCacheDirectoryIfNotExists

js/botasaurus-js/src/cache.ts:109–123  ·  view source on GitHub ↗
(func?: Function | string)

Source from the content-addressed store, hash-verified

107let cacheCheckDone = false;
108
109function _createCacheDirectoryIfNotExists(func?: Function | string): void {
110 if (!cacheCheckDone) {
111 cacheCheckDone = true;
112 createDirectoryIfNotExists(Cache.cacheDirectory);
113 }
114
115 if (func !== undefined) {
116 const fnName = getFnName(func);
117 if (!createdFns.has(fnName)) {
118 createdFns.add(fnName);
119 const fnCacheDir = path.join(Cache.cacheDirectory, fnName);
120 createDirectoryIfNotExists(fnCacheDir);
121 }
122 }
123}
124
125function getCachedFiles(func: Function | string): string[] {
126 const fnName = getFnName(func);

Callers 4

putMethod · 0.85
hasMethod · 0.85
getMethod · 0.85
deleteMethod · 0.85

Calls 5

getFnNameFunction · 0.85
addMethod · 0.80
joinMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected