(csvData: string)
| 175 | }*/ |
| 176 | |
| 177 | function splitCSVIntoLines(csvData: string): string[] { |
| 178 | // Regular expression to match CSV lines, ignoring newline characters inside quotes |
| 179 | const lines = csvData.match(/(?:[^"\n\r]+|"[^"]*")+?(?=\r?\n|$)/g); |
| 180 | |
| 181 | if (lines) { |
| 182 | const csvlines = lines.map((line) => line.trim()); |
| 183 | return csvlines; |
| 184 | } else { |
| 185 | return []; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | function loadCollection(collectionName: string) { |
| 190 | void loadDocumentStore(collectionName).then((docstore) => { |