UNPKG

power-di

Version:

A lightweight Dependency Injection library. Using es6 and other features, remove unnecessary concepts, easy and convenient to use.

23 lines 873 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.imports = void 0; var utils_1 = require("../utils"); var metadata_1 = require("../class/metadata"); /** subClasses/implements inject */ function imports(_a) { var type = _a.type, _b = _a.always, always = _b === void 0 ? false : _b; return function (target, key) { // if (getClsTypeByDecorator(undefined, target, key) !== Array) { // throw new Error(`${target.constructor.name}.${key.toString()}'s type need 'Array<T>' or 'T[]'.`); // } (0, metadata_1.getMetadata)(target.constructor).injects.push({ key: key, globalType: (0, utils_1.getGlobalType)(type), type: 'imports', always: always, typeCls: type, }); }; } exports.imports = imports; //# sourceMappingURL=imports.js.map