( packPath: string, tableNames: string[], executionContext?: FlowExecutionContext, )
| 148 | }; |
| 149 | |
| 150 | const getTableFilesForPackAndTables = async ( |
| 151 | packPath: string, |
| 152 | tableNames: string[], |
| 153 | executionContext?: FlowExecutionContext, |
| 154 | ): Promise<{ pack: Pack; matchingTablesByName: Map<string, PackedFile[]> }> => { |
| 155 | const pack = await readPackCached(packPath, { tablesToRead: tableNames }, executionContext); |
| 156 | getPacksTableData([pack], tableNames); |
| 157 | cacheTableFilesForPack(pack, tableNames, executionContext); |
| 158 | |
| 159 | const matchingTablesByName = new Map<string, PackedFile[]>(); |
| 160 | for (const tableName of tableNames) { |
| 161 | const cacheKey = `${pack.path}|${tableName}`; |
| 162 | const cachedTables = executionContext?.tableFilesByPackAndTable.get(cacheKey); |
| 163 | matchingTablesByName.set( |
| 164 | tableName, |
| 165 | cachedTables ?? |
| 166 | pack.packedFiles.filter((packedFile) => packedFile.name === tableName || packedFile.name.startsWith(`${tableName}\\`)), |
| 167 | ); |
| 168 | } |
| 169 | |
| 170 | return { pack, matchingTablesByName }; |
| 171 | }; |
| 172 | |
| 173 | const cloneNewPackedFile = (packedFile: NewPackedFile): NewPackedFile => ({ |
| 174 | name: packedFile.name, |
no test coverage detected