MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / readPackCached

Function readPackCached

src/nodeExecutor.ts:109–126  ·  view source on GitHub ↗
(
  packPath: string,
  packReadingOptions: PackReadingOptions,
  executionContext?: FlowExecutionContext,
)

Source from the content-addressed store, hash-verified

107};
108
109const readPackCached = async (
110 packPath: string,
111 packReadingOptions: PackReadingOptions,
112 executionContext?: FlowExecutionContext,
113): Promise<Pack> => {
114 if (!executionContext) {
115 return readPack(packPath, packReadingOptions);
116 }
117
118 const cacheKey = buildReadPackCacheKey(packPath, packReadingOptions);
119 let cachedPackPromise = executionContext.readPackCache.get(cacheKey);
120 if (!cachedPackPromise) {
121 cachedPackPromise = readPack(packPath, packReadingOptions);
122 executionContext.readPackCache.set(cacheKey, cachedPackPromise);
123 }
124
125 return cachedPackPromise;
126};
127
128const cacheTableFilesForPack = (
129 pack: Pack,

Calls 3

readPackFunction · 0.90
buildReadPackCacheKeyFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected