use .some instead of reduce

This commit is contained in:
Eneko Lakasta 2018-09-04 18:22:48 +02:00
parent 880ef63720
commit 6dde5fc6f1

View File

@ -28,8 +28,7 @@ MapConfigOverviewsAdapter.prototype.getMapConfig = function (user, requestMapCon
const layers = results.map(result => result.layer);
const overviewsAddedToMapconfig = results
.map(result => result.overviewsAddedToMapconfig)
.reduce((overviewsInMapconfig,overviewsInLayer)=>overviewsInMapconfig||overviewsInLayer,
false);
.some(overviewsInLayer => overviewsInLayer);
if (!layers || layers.length === 0) {
return callback(new Error('Missing layers array from layergroup config'));