(documentStore: documentStoreType)
| 133 | } |
| 134 | |
| 135 | async function updateStoreState(documentStore: documentStoreType) { |
| 136 | const documentNameSet = new Set( |
| 137 | (await documentStore.idb?.documents.toArray())?.map((doc) => doc.filehash) |
| 138 | ); |
| 139 | const documentCount = documentNameSet.size; |
| 140 | if (documentStore) { |
| 141 | vectorStoreState.value = { |
| 142 | ...vectorStoreState.value, |
| 143 | maxElements: documentStore.index?.getMaxElements() || 0, |
| 144 | numElements: documentStore.index?.getCurrentCount() || 0, |
| 145 | documentCount: documentCount, |
| 146 | }; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /*function parseCSV(csvData: string): string[][] { |
| 151 | // Regular expression to match CSV lines, even those containing quoted fields with commas and newlines |
no outgoing calls
no test coverage detected