UNPKG

ts-bakery

Version:

Baked dependency injection for Typescript.

36 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class DecoratorRegistry { static registerForInject(target, propertyKey) { this.injects.set(target['constructor'], target[propertyKey]); } static registerForPostInject(target, propertyKey) { this.postInjects.set(target['constructor'], target[propertyKey]); } static registerForPostResolve(target, propertyKey) { this.postResolves.set(target['constructor'], target[propertyKey]); } static getInjectMethod(constr) { if (this.injects.has(constr)) { return this.injects.get(constr); } return null; } static getPostInjectMethod(constr) { if (this.postInjects.has(constr)) { return this.postInjects.get(constr); } return null; } static getPostResolveMethod(constr) { if (this.postResolves.has(constr)) { return this.postResolves.get(constr); } return null; } } exports.default = DecoratorRegistry; DecoratorRegistry.injects = new Map(); DecoratorRegistry.postInjects = new Map(); DecoratorRegistry.postResolves = new Map(); //# sourceMappingURL=DecoratorRegistry.js.map