Skip to content

Commit

Permalink
fix: remove unneeded type guard
Browse files Browse the repository at this point in the history
  • Loading branch information
simonseyock committed Mar 14, 2022
1 parent 8c79103 commit 08d7479
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Util/typeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import OlTileLayer from 'ol/layer/Tile';

export type WmsLayer = OlImageLayer<OlImageWMS> | OlTileLayer<OlTileWMS> | OlLayer<OlImageWMS | OlTileWMS>;

export function isWmsLayer(layer: OlBaseLayer): layer is OlLayer<OlImageWMS | OlTileWMS, any> {
export function isWmsLayer(layer: OlBaseLayer): layer is WmsLayer {
if (layer instanceof OlLayer) {
const source = layer.getSource();
return source instanceof OlImageWMS || source instanceof OlTileWMS;
}
return false;
}

export function isImageOrTileLayer(layer: OlBaseLayer): layer is WmsLayer {
return layer instanceof OlImageLayer || layer instanceof OlTileLayer;
}

0 comments on commit 08d7479

Please sign in to comment.