Skip to content

Commit

Permalink
do not reference typescript type at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Jul 28, 2024
1 parent 3480aac commit c790d6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default {
if (/\/mathjs\//.test(id)) {
code = code.replace('export const path = "expression.transform"', '');
}
code = code.replace(/\/\*\*.*?\*\//gms, ''); // strip comments since they can have stray imports/exports
return code;
},
},
Expand Down
12 changes: 6 additions & 6 deletions src/schema/data-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ export function convertMatomoTypeToLooker(value: any, matomoType: string) {
export function mapMatomoAggregationTypeToLooker(matomoAggregation: string): AggregationType|undefined {
switch (matomoAggregation.toLowerCase()) {
case 'avg':
return AggregationType.AVG;
return cc.AggregationType.AVG;
case 'count': // TODO: do we really need to support count and count_distinct? does not seem to apply to matomo
return AggregationType.COUNT;
return cc.AggregationType.COUNT;
case 'count_distinct':
return AggregationType.COUNT_DISTINCT;
return cc.AggregationType.COUNT_DISTINCT;
case 'max':
return AggregationType.SUM;
return cc.AggregationType.SUM;
case 'min':
return AggregationType.MIN;
return cc.AggregationType.MIN;
case 'sum':
return AggregationType.SUM;
return cc.AggregationType.SUM;
default:
log(`unknown matomo aggregation type encountered: ${matomoAggregation}`);
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/schema/report-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function addMetric(
if (lookerFormula) {
field
.setFormula(lookerFormula)
.setAggregation(AggregationType.AUTO);
.setAggregation(cc.AggregationType.AUTO);
} else if (aggregationType) {
field.setAggregation(aggregationType);
} else {
Expand Down

0 comments on commit c790d6c

Please sign in to comment.