UNPKG

@trailstash/ultra

Version:

A web based tool for making MapLibre GL maps with data from sources such as Overpass, GeoJSON, GPX, KML, TCX, etc

12 lines (11 loc) 282 B
export const fetchIfHTTP = async (query) => { if (query.startsWith("http://") || query.startsWith("https://")) { try { const resp = await fetch(query, { cors: true }); if (resp.ok) { query = await resp.text(); } } catch {} } return query; };