Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function convertMeasure(measure: AFM.IMeasure): ExecuteAFM.IMeasure {
if (AFM.isSimpleMeasureDefinition(measure.definition)) {
const simpleMeasure = measure.definition.measure;
const filters = convertMeasureFilters(simpleMeasure.filters);
const filtersProp = filters ? { filters } : {};
return {
...measure,
definition: {
measure: {
...simpleMeasure,
...filtersProp,
},
},
};
}
return measure;