Skip to content

Commit 243d6d7

Browse files
committed
fix some types
1 parent cc054a2 commit 243d6d7

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/cubejs-schema-compiler/src/adapter/PreAggregations.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -674,21 +674,16 @@ export class PreAggregations {
674674

675675
/**
676676
* Expand granularity into array of granularity hierarchy.
677-
* @param {string} dimension Dimension in the form of `cube.timeDimension`
678-
* @param {string} granularity Granularity
679-
* @returns {Array<string>}
680677
*/
681-
const expandGranularity = (dimension, granularity) => (
678+
const expandGranularity = (dimension: string, granularity: string): Array<string> => (
682679
transformedQuery.granularityHierarchies[`${dimension}.${granularity}`] ||
683680
[granularity]
684681
);
685682

686683
/**
687684
* Determine whether time dimensions match to the window granularity or not.
688-
* @param {PreAggregationReferences} references
689-
* @returns {boolean}
690685
*/
691-
const windowGranularityMatches = (references) => {
686+
const windowGranularityMatches = (references: PreAggregationReferences): boolean => {
692687
if (!transformedQuery.windowGranularity) {
693688
return true;
694689
}
@@ -708,10 +703,8 @@ export class PreAggregations {
708703

709704
/**
710705
* Returns an array of 2-element arrays with dimension and granularity.
711-
* @param {*} timeDimension
712-
* @returns {Array<Array<string>>}
713706
*/
714-
const expandTimeDimension = (timeDimension) => {
707+
const expandTimeDimension = (timeDimension: string[]): string[][] => {
715708
const [dimension, resolvedGranularity] = timeDimension;
716709
if (!resolvedGranularity) {
717710
return [[dimension, '*']]; // Any granularity should fit

0 commit comments

Comments
 (0)