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.
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 oflayerInCapabilities
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.