@@ -94,7 +94,7 @@ export class YamlCompiler {
9494 return ;
9595 }
9696
97- const yamlObj = YAML . load ( file . content ) ;
97+ const yamlObj : any = YAML . load ( file . content ) ;
9898 if ( ! yamlObj ) {
9999 return ;
100100 }
@@ -116,7 +116,7 @@ export class YamlCompiler {
116116 }
117117 }
118118
119- private transpileAndPrepareJsFile ( file , methodFn , cubeObj , errorsReport : ErrorReporter ) {
119+ private transpileAndPrepareJsFile ( file : FileContent , methodFn : ( 'cube' | 'view' ) , cubeObj , errorsReport : ErrorReporter ) : FileContent {
120120 const yamlAst = this . transformYamlCubeObj ( cubeObj , errorsReport ) ;
121121
122122 const cubeOrViewCall = t . callExpression ( t . identifier ( methodFn ) , [ t . stringLiteral ( cubeObj . name ) , yamlAst ] ) ;
@@ -135,7 +135,7 @@ export class YamlCompiler {
135135 cubeObj . dimensions = this . yamlArrayToObj ( cubeObj . dimensions || [ ] , 'dimension' , errorsReport ) ;
136136 cubeObj . segments = this . yamlArrayToObj ( cubeObj . segments || [ ] , 'segment' , errorsReport ) ;
137137 cubeObj . preAggregations = this . yamlArrayToObj ( cubeObj . preAggregations || [ ] , 'preAggregation' , errorsReport ) ;
138- cubeObj . joins = this . yamlArrayToObj ( cubeObj . joins || [ ] , 'join' , errorsReport ) ;
138+ cubeObj . joins = cubeObj . joins || [ ] ; // For edge cases where joins are not defined/null
139139 cubeObj . hierarchies = this . yamlArrayToObj ( cubeObj . hierarchies || [ ] , 'hierarchies' , errorsReport ) ;
140140
141141 return this . transpileYaml ( cubeObj , [ ] , cubeObj . name , errorsReport ) ;
0 commit comments