From 7de79cb57b89a6f4d1d3ab48a06733ffc33eb64f Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Tue, 18 Oct 2022 11:49:30 +0200 Subject: [PATCH] removes unneeded index.d.ts and fixes wording Co-authored-by: jansule --- index.d.ts | 1 - src/SldStyleParser.ts | 36 ++++++++++++++++++------------------ 2 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 9b89b124..00000000 --- a/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module '@geostyler/xml2js'; diff --git a/src/SldStyleParser.ts b/src/SldStyleParser.ts index bfa14edf..a26c4720 100644 --- a/src/SldStyleParser.ts +++ b/src/SldStyleParser.ts @@ -286,16 +286,16 @@ export class SldStyleParser implements StyleParser { /** * The readStyle implementation of the geostyler-style StyleParser interface. * It reads a SLD as a string and returns a Promise. - * The Promise itself resolves with a geostyler-style. + * The Promise itself resolves with an object containing the geostyler-style. * * @param sldString A SLD as a string. - * @return The Promise resolving with the geostyler-style + * @return The Promise resolving with an object containing the geostyler-style. */ readStyle(sldString: string): Promise { return new Promise((resolve) => { try { - const output = this.parser.parse(sldString); - const geoStylerStyle: Style = this.sldObjectToGeoStylerStyle(output); + const sldObject = this.parser.parse(sldString); + const geoStylerStyle: Style = this.sldObjectToGeoStylerStyle(sldObject); resolve({ output: geoStylerStyle }); @@ -1138,7 +1138,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style * * @param geoStylerStyle A geostyler-style. * @return The object representation of a SLD Style (readable with fast-xml-parser) @@ -1198,7 +1198,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style Rule. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style Rule. * * @param rules An array of geostyler-style Rules. * @return The object representation of a SLD Rule (readable with fast-xml-parser) @@ -1268,7 +1268,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style ComparisonFilter. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style ComparisonFilter. * * @param comparisonFilter A geostyler-style ComparisonFilter. * @return The object representation of a SLD Filter Expression with a @@ -1358,7 +1358,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style Filter. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style Filter. * * @param filter A geostyler-style Filter. * @return The object representation of a SLD Filter Expression (readable with fast-xml-parser) @@ -1439,7 +1439,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style MarkSymbolizer. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style MarkSymbolizer. * * @param markSymbolizer A geostyler-style MarkSymbolizer. * @return The object representation of a SLD PointSymbolizer with a Mark @@ -1581,7 +1581,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style IconSymbolizer. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style IconSymbolizer. * * @param iconSymbolizer A geostyler-style IconSymbolizer. * @return The object representation of a SLD PointSymbolizer with @@ -1653,7 +1653,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style TextSymbolizer. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style TextSymbolizer. * * @param textSymbolizer A geostyler-style TextSymbolizer. * @return The object representation of a SLD TextSymbolizer (readable with fast-xml-parser) @@ -1893,7 +1893,7 @@ export class SldStyleParser implements StyleParser { }; /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style LineSymbolizer. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style LineSymbolizer. * * @param lineSymbolizer A geostyler-style LineSymbolizer. * @return The object representation of a SLD LineSymbolizer (readable with fast-xml-parser) @@ -2014,7 +2014,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style FillSymbolizer. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style FillSymbolizer. * * @param fillSymbolizer A geostyler-style FillSymbolizer. * @return The object representation of a SLD PolygonSymbolizer (readable with fast-xml-parser) @@ -2126,7 +2126,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style RasterSymbolizer. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style RasterSymbolizer. * * @param rasterSymbolizer A geostyler-style RasterSymbolizer. * @return The object representation of a SLD RasterSymbolizer (readable with fast-xml-parser) @@ -2173,7 +2173,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style ColorMap. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style ColorMap. * * @param colorMap A geostyler-style ColorMap. * @return The object representation of a SLD ColorMap (readable with fast-xml-parser) @@ -2223,7 +2223,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style ChannelSelection. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style ChannelSelection. * * @param channelSelection A geostyler-style ChannelSelection. * @return The object representation of a SLD ChannelSelection (readable with fast-xml-parser) @@ -2267,7 +2267,7 @@ export class SldStyleParser implements StyleParser { } /** - * Get the SLD Object (readable with fast-xml-parser) from an geostyler-style ContrastEnhancement. + * Get the SLD Object (readable with fast-xml-parser) from a geostyler-style ContrastEnhancement. * * @param contrastEnhancement A geostyler-style ContrastEnhancement. * @return The object representation of a SLD ContrastEnhancement (readable with fast-xml-parser) @@ -2301,7 +2301,7 @@ export class SldStyleParser implements StyleParser { const capitalizeFirstLetter = (a: string) => a[0].toUpperCase() + a.slice(1); const unsupportedProperties: UnsupportedProperties = {}; geoStylerStyle.rules.forEach(rule => { - // ScaleDenominator and Filters are completly supported so we just check for symbolizers + // ScaleDenominator and Filters are completely supported so we just check for symbolizers rule.symbolizers.forEach(symbolizer => { const key = capitalizeFirstLetter(`${symbolizer.kind}Symbolizer`); const value = this.unsupportedProperties?.Symbolizer?.[key];