Replace nested conditional with guard clause (early return)

This commit is contained in:
Daniel García Aubert 2017-12-12 10:43:49 +01:00
parent 5bf4eba215
commit 06efe410ef

View File

@ -197,15 +197,15 @@ module.exports = class AggregationMapConfigAdapter {
} }
_getAggregationMetadata (isVectorOnlyMapConfig, layer, adapted) { _getAggregationMetadata (isVectorOnlyMapConfig, layer, adapted) {
if (adapted) { if (!adapted) {
if (isVectorOnlyMapConfig) { return { png: false, mvt: false };
return { png: false, mvt: true };
}
return { png: true, mvt: true };
} }
return { png: false, mvt: false }; if (isVectorOnlyMapConfig) {
return { png: false, mvt: true };
}
return { png: true, mvt: true };
} }
_getAggregationColumns (aggregation) { _getAggregationColumns (aggregation) {