|
1 | 1 | "use strict"; |
2 | 2 | Object.defineProperty(exports, "__esModule", { value: true }); |
3 | | -require("reflect-metadata"); |
4 | 3 | const deprecate = require("deprecate"); |
| 4 | +require("reflect-metadata"); |
5 | 5 | const constants_1 = require("../../constants"); |
6 | 6 | const invalid_module_config_exception_1 = require("./exceptions/invalid-module-config.exception"); |
7 | 7 | const metadataKeys = [ |
8 | | - constants_1.metadata.MODULES, |
9 | | - constants_1.metadata.IMPORTS, |
10 | | - constants_1.metadata.EXPORTS, |
11 | | - constants_1.metadata.COMPONENTS, |
12 | | - constants_1.metadata.CONTROLLERS, |
13 | | - constants_1.metadata.PROVIDERS, |
| 8 | + constants_1.METADATA.MODULES, |
| 9 | + constants_1.METADATA.IMPORTS, |
| 10 | + constants_1.METADATA.EXPORTS, |
| 11 | + constants_1.METADATA.COMPONENTS, |
| 12 | + constants_1.METADATA.CONTROLLERS, |
| 13 | + constants_1.METADATA.PROVIDERS, |
14 | 14 | ]; |
15 | 15 | const validateKeys = (keys) => { |
16 | 16 | const isKeyInvalid = key => metadataKeys.findIndex(k => k === key) < 0; |
@@ -54,8 +54,8 @@ function overrideModuleMetadata(moduleMetadata) { |
54 | 54 | : moduleMetadata.components; |
55 | 55 | } |
56 | 56 | function showDeprecatedWarnings(moduleMetadata) { |
57 | | - const modulesDeprecatedWarning = 'The "modules" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "imports" key instead.'; |
58 | | - const componentsDeprecatetWarning = 'The "components" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "providers" key instead.'; |
59 | | - moduleMetadata.modules && deprecate(modulesDeprecatedWarning); |
60 | | - moduleMetadata.components && deprecate(componentsDeprecatetWarning); |
| 57 | + const MODULES_DEPRECATED_WARNING = 'The "modules" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "imports" key instead.'; |
| 58 | + const COMPONENTS_DEPRECATED_WARNING = 'The "components" key in the @Module() decorator is deprecated and will be removed within next major release. Use the "providers" key instead.'; |
| 59 | + moduleMetadata.modules && deprecate(MODULES_DEPRECATED_WARNING); |
| 60 | + moduleMetadata.components && deprecate(COMPONENTS_DEPRECATED_WARNING); |
61 | 61 | } |
0 commit comments