Dynamic Schema with PreAggregations

If i define preaggregations with dynamic schema getting this error…
Error: Error: Compile errors:
General cube: (preAggregations.HeadCountByRevision.timeDimension = General.RevisionDate) must be of type function

Json Format:
“dimensions”:{“RevisionDate”:{“type”:“time”,“sql”:“iRevisionDate”,“primaryKey”:false,“shown”:true},
{“iMasterId”:{“type”:“number”,“sql”:“iMasterId”,“primaryKey”:true,“shown”:false}},
“mesures”:{“HeadCount”:{“type”:“count”,“sql”:“iMasterId”}},“joins”:{},
“preAggregations”:{“HeadCountByRevision”:{“type”:“rollup”,“dimensions”:null,
“measures”:"[General.HeadCount]",“timeDimension”:“General.RevisionDate”,“granularity”:“day”}}

Transform Function:
export const transformPreAggregations = (preAggregations) => {

return Object.keys(preAggregations).reduce((result, preAggregationsName) => {

const preAggregationsDefinition = preAggregations[preAggregationsName];

return {

  ...result,

  [preAggregationsName]: convertStringPropToFunction(

    ['sql'],

    preAggregationsDefinition

  ),

};

}, {});

};

Defining the Cube:
cube(dynamicCube.title, {

  sql: dynamicCube.sql,

  dimensions,

  measures,

  joins,

  preAggregations

})