mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-10 08:25:39 +00:00
18 lines
387 B
TypeScript
18 lines
387 B
TypeScript
export class SymbolManager {
|
|
private symbolMap: { [symbolName: string]: symbol } = {};
|
|
|
|
public create(name: string): symbol {
|
|
if (this.symbolMap[name]) {
|
|
return this.symbolMap[name];
|
|
}
|
|
this.symbolMap[name] = Symbol(name);
|
|
return this.symbolMap[name];
|
|
}
|
|
|
|
public get(name: string) {
|
|
return this.symbolMap[name];
|
|
}
|
|
}
|
|
|
|
export default new SymbolManager();
|