gpx file class with first operation

This commit is contained in:
vcoppe
2024-04-16 13:54:48 +02:00
parent b5eebacc02
commit c1d27b1488
7 changed files with 4302 additions and 3831 deletions

View File

@@ -1,5 +1,6 @@
import { XMLParser, XMLBuilder } from "fast-xml-parser";
import { GPXFile } from "./types";
import { GPXFileType } from "./types";
import { GPXFile } from "./gpx";
export function parseGPX(gpxData: string): GPXFile {
const parser = new XMLParser({
@@ -49,9 +50,9 @@ export function parseGPX(gpxData: string): GPXFile {
},
});
const parsed = parser.parse(gpxData);
const parsed: GPXFileType = parser.parse(gpxData).gpx;
return parsed.gpx;
return new GPXFile(parsed);
}