File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed
Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -82,18 +82,18 @@ export const parseGPXWithCustomParser = (
8282 email :
8383 emailElement !== null
8484 ? {
85- id : emailElement . getAttribute ( "id" ) ?? "" ,
86- domain :
87- emailElement . getAttribute ( "domain" ) ?? "" ,
88- }
85+ id : emailElement . getAttribute ( "id" ) ?? "" ,
86+ domain :
87+ emailElement . getAttribute ( "domain" ) ?? "" ,
88+ }
8989 : null ,
9090 link :
9191 linkElement !== null
9292 ? {
93- href : linkElement . getAttribute ( "href" ) ?? "" ,
94- text : getElementValue ( linkElement , "text" ) ,
95- type : getElementValue ( linkElement , "type" ) ,
96- }
93+ href : linkElement . getAttribute ( "href" ) ?? "" ,
94+ text : getElementValue ( linkElement , "text" ) ,
95+ type : getElementValue ( linkElement , "type" ) ,
96+ }
9797 : null ,
9898 }
9999 }
@@ -322,9 +322,7 @@ const getElementValue = (parent: Element, tag: string): string => {
322322
323323 // Extract and return the value within the parent element
324324 if ( element !== null ) {
325- return element . innerHTML != undefined
326- ? element . innerHTML
327- : element . childNodes [ 0 ] . textContent ?? ""
325+ return element . firstChild ?. textContent ?? element . innerHTML ?? ""
328326 } else return ""
329327}
330328
Original file line number Diff line number Diff line change 22 "name" : " @we-gold/gpxjs" ,
33 "author" : " Weaver Goldman <we.goldm@gmail.com>" ,
44 "description" : " GPX.js is a modern library for parsing GPX files and converting them to GeoJSON." ,
5- "version" : " 1.0.9 " ,
5+ "version" : " 1.0.10 " ,
66 "type" : " module" ,
77 "license" : " MIT" ,
88 "repository" : {
You can’t perform that action at this time.
0 commit comments