UNPKG

zents

Version:

ZenTS is a Node.js & TypeScript MVC-Framework for building rich web applications, released as free and open-source software under the MIT License. It is designed for building web applications with modern tools and design patterns.

26 lines 860 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ServiceFactory = void 0; const AbstractFactory_1 = require("../core/AbstractFactory"); class ServiceFactory extends AbstractFactory_1.AbstractFactory { constructor(services, emailFactory, sessionFactory, securityProviders, databaseContainer) { super(); this.services = services; this.injector = this.buildInjector({ databaseContainer, emailFactory, sessionFactory, securityProviders, }); } build(key) { const module = this.services.get(key); if (!module) { return null; } const instance = this.injector.inject(module, []); return instance; } } exports.ServiceFactory = ServiceFactory; //# sourceMappingURL=ServiceFactory.js.map