Skip to content

Commit

Permalink
fix: file extension logic
Browse files Browse the repository at this point in the history
  • Loading branch information
olsen232 committed Dec 9, 2024
1 parent e705de2 commit bebae36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const getParserFromFormat = (inputString: string): StyleParser | undefined => {
case 'qgis':
case 'qml':
return new QGISParser();
case 'geostyler':
return new GeoStylerParser();
default:
return undefined;
}
Expand All @@ -57,7 +59,7 @@ const getParserFromFilename = (fileName: string): StyleParser | undefined => {
if (!fileName) {
return undefined;
}
const fileEnding = fileName.split('.')[1];
const fileEnding = fileName.split('.').pop();
if (!fileEnding) {
return undefined;
}
Expand All @@ -72,6 +74,8 @@ const getParserFromFilename = (fileName: string): StyleParser | undefined => {
return new SLDParser();
case 'qml':
return new QGISParser();
case 'geostyler':
return new GeostylerParser();
default:
return undefined;
}
Expand Down

0 comments on commit bebae36

Please sign in to comment.