Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function convertMeasureDefinition(definition: IMeasureDefinitionType): AFM.MeasureDefinition {
if (VisualizationObject.isMeasureDefinition(definition)) {
return convertSimpleMeasureDefinition(definition);
} else if (VisualizationObject.isPopMeasureDefinition(definition)) {
return convertPopMeasureDefinition(definition);
} else if (VisualizationObject.isPreviousPeriodMeasureDefinition(definition)) {
return convertPreviousPeriodMeasureDefinition(definition);
} else if (VisualizationObject.isArithmeticMeasureDefinition(definition)) {
return convertArithmeticMeasureDefinition(definition);
} else {
throw Error("The measure definition is not supported: " + JSON.stringify(definition));
}
}