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,7 +197,10 @@ module.exports = class AggregationMapConfigAdapter {
}
_getAggregationMetadata (isVectorOnlyMapConfig, layer, adapted) {
if (adapted) {
if (!adapted) {
return { png: false, mvt: false };
}
if (isVectorOnlyMapConfig) {
return { png: false, mvt: true };
}
@ -205,9 +208,6 @@ module.exports = class AggregationMapConfigAdapter {
return { png: true, mvt: true };
}
return { png: false, mvt: false };
}
_getAggregationColumns (aggregation) {
const hasAggregationColumns = aggregation !== undefined &&
typeof aggregation !== 'boolean' &&