jetup
Version:
Jetup: JavaScript Project Setup! Jetting-up your next JS project in seconds with one command, using fully modular, customizable presets, instantly ready to code!.
36 lines • 921 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModuleRegistry = void 0;
class ModuleRegistry {
constructor() {
this._registry = new Map();
}
register(key, value) {
this._registry.set(key, value);
}
get(key) {
const named = this._registry.get(key);
if (!named) {
throw new Error(`Class ${key.name} is not registered.`);
}
return named;
}
keys() {
const result = [];
for (const klass of this._registry.values()) {
result.push(klass.name);
}
return result;
}
values() {
const result = [];
for (const klass of this._registry.values()) {
result.push({
name: klass.name,
});
}
return result;
}
}
exports.ModuleRegistry = ModuleRegistry;
//# sourceMappingURL=registry.js.map