(url)
| 215 | * @param {string} url - URL to a CSV file |
| 216 | */ |
| 217 | export async function readCSVFromURL(url) { |
| 218 | |
| 219 | let rows = [] |
| 220 | |
| 221 | await fetchCSV({ |
| 222 | url: url, |
| 223 | }).then(d => { |
| 224 | rows = d; |
| 225 | }).catch(error_json => { |
| 226 | let msg = "undefined error" |
| 227 | if (Array.isArray(error_json.message)) { |
| 228 | msg = error_json.message.join('<br>') |
| 229 | } else { |
| 230 | msg = String(error_json.message) |
| 231 | } |
| 232 | throw new TLError(msg) |
| 233 | }) |
| 234 | |
| 235 | return processCSVRows(rows) |
| 236 | } |
| 237 | |
| 238 | /** |
| 239 | * Determines if a URL appears to be a CSV file based on its extension or content type. |
no test coverage detected