UNPKG

@nodeboot/di

Version:

Dependency Injection plugin for Node-Boot

19 lines 922 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.REQUIRES_FIELD_INJECTION_KEY = void 0; exports.Inject = Inject; const ioc_1 = require("../ioc"); exports.REQUIRES_FIELD_INJECTION_KEY = "custom:requiresFieldInjection"; function Inject(options) { return (target, propertyName, index) => { // Registering metadata for custom filed injection (used for example in the Persistence Event Subscribers) if (propertyName && typeof propertyName === "string") { const injectProperties = Reflect.getMetadata(exports.REQUIRES_FIELD_INJECTION_KEY, target) || []; injectProperties.push(propertyName); Reflect.defineMetadata(exports.REQUIRES_FIELD_INJECTION_KEY, injectProperties, target); } // Normal injection (0, ioc_1.decorateInjection)(target, propertyName, index, options); }; } //# sourceMappingURL=Inject.js.map