How to use the @gooddata/typings.AFM.isSimpleMeasureDefinition function in @gooddata/typings

To help you get started, we’ve selected a few @gooddata/typings examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gooddata / gooddata-js / src / execution / execute-afm.convert.ts View on Github external
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;