UNPKG

@buka/nestjs-config

Version:
24 lines (23 loc) 1.06 kB
(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports", "../configuration-registry"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigKey = void 0; const configuration_registry_1 = require("../configuration-registry"); function ConfigKey(key) { return (target, propertyKey) => { if (typeof propertyKey === 'symbol' && typeof key !== 'string') { throw new Error('[@buka/nestjs-config] @ConfigKey("YOUR_KEY") must be set, if the property key of the class is a symbol'); } configuration_registry_1.ConfigurationRegistry.registerProperty(target, { propertyKey, configKey: key, ignore: false }); }; } exports.ConfigKey = ConfigKey; });