( packedFile: Pick<PackedFile, "schemaFields" | "tableSchema">, executionContext?: FlowExecutionContext, )
| 60 | }; |
| 61 | |
| 62 | const getRowsForPackedFile = ( |
| 63 | packedFile: Pick<PackedFile, "schemaFields" | "tableSchema">, |
| 64 | executionContext?: FlowExecutionContext, |
| 65 | ): AmendedSchemaField[][] => { |
| 66 | if (!packedFile.schemaFields || !packedFile.tableSchema) { |
| 67 | return []; |
| 68 | } |
| 69 | |
| 70 | if (!executionContext) { |
| 71 | return chunkSchemaIntoRows(packedFile.schemaFields, packedFile.tableSchema) as AmendedSchemaField[][]; |
| 72 | } |
| 73 | |
| 74 | const cachedRows = executionContext.rowsByPackedFile.get(packedFile as PackedFile); |
| 75 | if (cachedRows) { |
| 76 | return cachedRows; |
| 77 | } |
| 78 | |
| 79 | const rows = chunkSchemaIntoRows(packedFile.schemaFields, packedFile.tableSchema) as AmendedSchemaField[][]; |
| 80 | executionContext.rowsByPackedFile.set(packedFile as PackedFile, rows); |
| 81 | return rows; |
| 82 | }; |
| 83 | |
| 84 | const getColumnIndexForPackedFile = ( |
| 85 | packedFile: Pick<PackedFile, "tableSchema">, |
no test coverage detected