MCPcopy Index your code
hub / github.com/NUKnightLab/TimelineJS3 / readCSVFromURL

Function readCSVFromURL

src/js/core/ConfigFactory.js:217–236  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

215 * @param {string} url - URL to a CSV file
216 */
217export 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.

Callers 1

makeConfigFunction · 0.85

Calls 2

fetchCSVFunction · 0.90
processCSVRowsFunction · 0.85

Tested by

no test coverage detected