File tree Expand file tree Collapse file tree 2 files changed +30
-20
lines changed
packages/cubejs-schema-compiler/src/compiler Expand file tree Collapse file tree 2 files changed +30
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import type { ErrorReporter } from './ErrorReporter' ;
2+ import { TranspilerCubeResolver } from './transpilers' ;
3+
4+ export interface Cube {
5+ name : string ;
6+ [ key : string ] : any ;
7+ }
8+
9+ export class CubeDictionary implements TranspilerCubeResolver {
10+ public byId : Record < string , Cube > ;
11+
12+ public constructor ( ) {
13+ this . byId = { } ;
14+ }
15+
16+ public compile ( cubes : Cube [ ] , _errorReporter ?: ErrorReporter ) : void {
17+ this . byId = { } ;
18+ for ( const cube of cubes ) {
19+ this . byId [ cube . name ] = cube ;
20+ }
21+ }
22+
23+ public resolveCube ( name : string ) : boolean {
24+ return ! ! this . byId [ name ] ;
25+ }
26+
27+ public free ( ) : void {
28+ this . byId = { } ;
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments