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

Function cacheTableFilesForPack

src/nodeExecutor.ts:128–148  ·  view source on GitHub ↗
(
  pack: Pack,
  tableNames: string[],
  executionContext?: FlowExecutionContext,
)

Source from the content-addressed store, hash-verified

126};
127
128const cacheTableFilesForPack = (
129 pack: Pack,
130 tableNames: string[],
131 executionContext?: FlowExecutionContext,
132): void => {
133 if (!executionContext) {
134 return;
135 }
136
137 for (const tableName of tableNames) {
138 const cacheKey = `${pack.path}|${tableName}`;
139 if (executionContext.tableFilesByPackAndTable.has(cacheKey)) {
140 continue;
141 }
142
143 executionContext.tableFilesByPackAndTable.set(
144 cacheKey,
145 pack.packedFiles.filter((packedFile) => packedFile.name === tableName || packedFile.name.startsWith(`${tableName}\\`)),
146 );
147 }
148};
149
150const getTableFilesForPackAndTables = async (
151 packPath: string,

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected