src/operator/group-by.js
function getFieldArr (dataModel, fieldArr) {
    const retArr = [];
    const fieldStore = dataModel.getFieldspace();
    const dimensions = fieldStore.getDimension();

    Object.entries(dimensions).forEach(([key]) => {
        if (fieldArr && fieldArr.length) {
            if (fieldArr.indexOf(key) !== -1) {
                retArr.push(key);
            }
        } else {
            retArr.push(key);
        }
    });

    return retArr;
}
function getFieldArr (dataModel, fieldArr) {
    const retArr = [];
    const fieldStore = dataModel.getFieldspace();
    const dimensions = fieldStore.getDimension();

    Object.entries(dimensions).forEach(([key]) => {
        if (fieldArr && fieldArr.length) {
            if (fieldArr.indexOf(key) !== -1) {
                retArr.push(key);
            }
        } else {
            retArr.push(key);
        }
    });

    return retArr;
}
function getFieldArr ( dataModel , fieldArr ) { const retArr = [ ] ; const fieldStore = dataModel . getFieldspace ( ) ; const dimensions = fieldStore . getDimension ( ) ; Object . entries ( dimensions ) . forEach ( ( [ key ] ) => { if ( fieldArr && fieldArr . length ) { if ( fieldArr . indexOf ( key ) !== - 1 ) { retArr . push ( key ) ; } } else { retArr . push ( key ) ; } } ) ; return retArr ; }
This function sanitize the user given field and return a common Array structure field
list
@param  {DataModel} dataModel the dataModel operating on
@param  {Array} fieldArr  user input of field Array
@return {Array}           arrays of field name
This function sanitize the user given field and return a common Array structure field list