Skip to content

Commit e31c7cc

Browse files
committed
Move CubeDictionary to TS
1 parent 47e8c20 commit e31c7cc

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

packages/cubejs-schema-compiler/src/compiler/CubeDictionary.js

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { ErrorReporter } from './ErrorReporter';
2+
3+
export class CubeDictionary {
4+
public byId: Record<string, any>;
5+
6+
public constructor() {
7+
this.byId = {};
8+
}
9+
10+
public compile(cubes: any[], _errorReporter: ErrorReporter) {
11+
this.byId = Object.fromEntries(cubes.map(v => [v.name, v]));
12+
}
13+
14+
public resolveCube(cubeName: string): any {
15+
return this.byId[cubeName];
16+
}
17+
}

0 commit comments

Comments
 (0)