UNPKG

tg-commander

Version:

<p align="center"><img src="https://github.com/stone-jin/tg-commander/raw/master/assets/logo.png" alt="tg-commander logo" width="150px" height="150px"></p>

25 lines (24 loc) 729 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var InjectManager = /** @class */ (function () { function InjectManager() { this.maps = new Map(); } InjectManager.getInstance = function () { if (!this._instance) { this._instance = new InjectManager(); } return this._instance; }; InjectManager.prototype.getType = function (key) { if (!this.maps.get(key)) { this.maps.set(key, new key()); } return this.maps.get(key); }; InjectManager.prototype.setType = function (key, value) { this.maps.set(key, value); }; return InjectManager; }()); exports.InjectManager = InjectManager;