@osm-editor-kit/osm-data 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -4
- package/package.json +1 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
|
|
3
1
|
// src/data-client.ts
|
|
4
2
|
function emptyParsedOsmData() {
|
|
5
3
|
return {
|
|
@@ -40,12 +38,13 @@ async function downloadOsmData(url) {
|
|
|
40
38
|
return parseOsmResp(osmResp);
|
|
41
39
|
}
|
|
42
40
|
async function downloadContent(url) {
|
|
43
|
-
const resp = await
|
|
41
|
+
const resp = await fetch(url, {
|
|
44
42
|
headers: {
|
|
45
43
|
Accept: "application/json"
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
|
-
|
|
46
|
+
if (!resp.ok) throw new Error(`Request failed with status code ${resp.status}`);
|
|
47
|
+
return resp.json();
|
|
49
48
|
}
|
|
50
49
|
function parseOsmResp(osmResp) {
|
|
51
50
|
const newData = emptyParsedOsmData();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osm-editor-kit/osm-data",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Download, parse, and merge OSM API/Overpass responses into an indexed in-memory store.",
|
|
5
5
|
"homepage": "https://github.com/osm-editor-kit/street-space-editor/tree/main/packages/osm-data",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,9 +34,6 @@
|
|
|
34
34
|
"prepack": "bun ../../scripts/package-exports-for-publish.ts",
|
|
35
35
|
"postpack": "bun ../../scripts/package-exports-restore.ts"
|
|
36
36
|
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"axios": "^1.11.0"
|
|
39
|
-
},
|
|
40
37
|
"devDependencies": {
|
|
41
38
|
"bun-types": "^1.2.20",
|
|
42
39
|
"tsup": "^8.5.1",
|