terrestris / ol-util

A set of helper classes for working with OpenLayers
https://terrestris.github.io/ol-util
BSD 2-Clause "Simplified" License
48 stars 22 forks source link

fix: fixes the function so it accepts packages that do not return an array #1504

Closed faouziH21 closed 1 month ago

faouziH21 commented 1 month ago

In case layerInCapabilities is not an Array but an object the .map() function would fail since the parameters were wrong. This PR fixes this problem by adding a simple yet effective way to solve this issue. Since the returned data type of layerInCapabilities is either an array or an object, we can check if it's an Array, if not we transform it into an array with the length of one. This avoids major code refactoring.

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 19.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: