UNPKG

@hestjs/core

Version:

HestJS Core Framework - A TypeScript framework built on Hono with dependency injection and decorators

19 lines 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Module = Module; require("reflect-metadata"); const constants_1 = require("../utils/constants"); /** * 模块装饰器 * @param metadata 模块元数据 */ function Module(metadata) { return (target) => { Reflect.defineMetadata(constants_1.METADATA_KEYS.MODULE, metadata, target); // 确保模块可以被注入 if (!Reflect.hasMetadata(constants_1.METADATA_KEYS.INJECTABLE, target)) { Reflect.defineMetadata(constants_1.METADATA_KEYS.INJECTABLE, { scope: 'singleton' }, target); } }; } //# sourceMappingURL=module.js.map