@nestjs/common 11.1.15 → 12.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/constants.js +35 -38
  2. package/decorators/core/apply-decorators.js +1 -4
  3. package/decorators/core/bind.decorator.js +1 -4
  4. package/decorators/core/catch.decorator.d.ts +1 -1
  5. package/decorators/core/catch.decorator.js +4 -7
  6. package/decorators/core/controller.decorator.d.ts +1 -1
  7. package/decorators/core/controller.decorator.js +10 -13
  8. package/decorators/core/dependencies.decorator.js +4 -9
  9. package/decorators/core/exception-filters.decorator.d.ts +1 -1
  10. package/decorators/core/exception-filters.decorator.js +10 -14
  11. package/decorators/core/index.d.ts +14 -14
  12. package/decorators/core/index.js +14 -17
  13. package/decorators/core/inject.decorator.d.ts +1 -1
  14. package/decorators/core/inject.decorator.js +9 -12
  15. package/decorators/core/injectable.decorator.d.ts +2 -2
  16. package/decorators/core/injectable.decorator.js +7 -11
  17. package/decorators/core/optional.decorator.js +8 -11
  18. package/decorators/core/set-metadata.decorator.js +1 -5
  19. package/decorators/core/use-guards.decorator.d.ts +1 -1
  20. package/decorators/core/use-guards.decorator.js +10 -13
  21. package/decorators/core/use-interceptors.decorator.d.ts +1 -1
  22. package/decorators/core/use-interceptors.decorator.js +10 -13
  23. package/decorators/core/use-pipes.decorator.d.ts +1 -1
  24. package/decorators/core/use-pipes.decorator.js +9 -12
  25. package/decorators/core/version.decorator.d.ts +1 -1
  26. package/decorators/core/version.decorator.js +3 -6
  27. package/decorators/http/create-route-param-metadata.decorator.d.ts +6 -5
  28. package/decorators/http/create-route-param-metadata.decorator.js +48 -16
  29. package/decorators/http/header.decorator.js +4 -7
  30. package/decorators/http/http-code.decorator.js +3 -6
  31. package/decorators/http/index.d.ts +8 -8
  32. package/decorators/http/index.js +8 -11
  33. package/decorators/http/redirect.decorator.js +3 -6
  34. package/decorators/http/render.decorator.js +3 -6
  35. package/decorators/http/request-mapping.decorator.d.ts +1 -1
  36. package/decorators/http/request-mapping.decorator.js +28 -32
  37. package/decorators/http/route-params.decorator.d.ts +153 -3
  38. package/decorators/http/route-params.decorator.js +124 -49
  39. package/decorators/http/sse.decorator.d.ts +2 -2
  40. package/decorators/http/sse.decorator.js +7 -10
  41. package/decorators/index.d.ts +3 -3
  42. package/decorators/index.js +3 -6
  43. package/decorators/modules/global.decorator.js +3 -6
  44. package/decorators/modules/index.d.ts +2 -2
  45. package/decorators/modules/index.js +2 -5
  46. package/decorators/modules/module.decorator.d.ts +1 -1
  47. package/decorators/modules/module.decorator.js +3 -6
  48. package/enums/http-status.enum.js +2 -5
  49. package/enums/index.d.ts +4 -4
  50. package/enums/index.js +4 -7
  51. package/enums/request-method.enum.js +2 -5
  52. package/enums/route-paramtypes.enum.js +2 -5
  53. package/enums/shutdown-signal.enum.js +2 -5
  54. package/enums/version-type.enum.js +2 -5
  55. package/exceptions/bad-gateway.exception.d.ts +1 -1
  56. package/exceptions/bad-gateway.exception.js +5 -9
  57. package/exceptions/bad-request.exception.d.ts +1 -1
  58. package/exceptions/bad-request.exception.js +5 -9
  59. package/exceptions/conflict.exception.d.ts +1 -1
  60. package/exceptions/conflict.exception.js +5 -9
  61. package/exceptions/forbidden.exception.d.ts +1 -1
  62. package/exceptions/forbidden.exception.js +5 -9
  63. package/exceptions/gateway-timeout.exception.d.ts +1 -1
  64. package/exceptions/gateway-timeout.exception.js +5 -9
  65. package/exceptions/gone.exception.d.ts +1 -1
  66. package/exceptions/gone.exception.js +5 -9
  67. package/exceptions/http-version-not-supported.exception.d.ts +1 -1
  68. package/exceptions/http-version-not-supported.exception.js +5 -9
  69. package/exceptions/http.exception.d.ts +6 -2
  70. package/exceptions/http.exception.js +36 -17
  71. package/exceptions/im-a-teapot.exception.d.ts +1 -1
  72. package/exceptions/im-a-teapot.exception.js +5 -9
  73. package/exceptions/index.d.ts +23 -23
  74. package/exceptions/index.js +23 -26
  75. package/exceptions/internal-server-error.exception.d.ts +1 -1
  76. package/exceptions/internal-server-error.exception.js +5 -9
  77. package/exceptions/intrinsic.exception.js +1 -5
  78. package/exceptions/method-not-allowed.exception.d.ts +1 -1
  79. package/exceptions/method-not-allowed.exception.js +5 -9
  80. package/exceptions/misdirected.exception.d.ts +1 -1
  81. package/exceptions/misdirected.exception.js +5 -9
  82. package/exceptions/not-acceptable.exception.d.ts +1 -1
  83. package/exceptions/not-acceptable.exception.js +5 -9
  84. package/exceptions/not-found.exception.d.ts +1 -1
  85. package/exceptions/not-found.exception.js +5 -9
  86. package/exceptions/not-implemented.exception.d.ts +1 -1
  87. package/exceptions/not-implemented.exception.js +5 -9
  88. package/exceptions/payload-too-large.exception.d.ts +1 -1
  89. package/exceptions/payload-too-large.exception.js +5 -9
  90. package/exceptions/precondition-failed.exception.d.ts +1 -1
  91. package/exceptions/precondition-failed.exception.js +5 -9
  92. package/exceptions/request-timeout.exception.d.ts +1 -1
  93. package/exceptions/request-timeout.exception.js +5 -9
  94. package/exceptions/service-unavailable.exception.d.ts +1 -1
  95. package/exceptions/service-unavailable.exception.js +5 -9
  96. package/exceptions/unauthorized.exception.d.ts +1 -1
  97. package/exceptions/unauthorized.exception.js +5 -9
  98. package/exceptions/unprocessable-entity.exception.d.ts +1 -1
  99. package/exceptions/unprocessable-entity.exception.js +5 -9
  100. package/exceptions/unsupported-media-type.exception.d.ts +1 -1
  101. package/exceptions/unsupported-media-type.exception.js +5 -9
  102. package/file-stream/index.d.ts +1 -1
  103. package/file-stream/index.js +1 -4
  104. package/file-stream/interfaces/index.d.ts +2 -2
  105. package/file-stream/interfaces/index.js +2 -5
  106. package/file-stream/interfaces/streamable-handler-response.interface.js +1 -2
  107. package/file-stream/interfaces/streamable-options.interface.js +1 -2
  108. package/file-stream/streamable-file.d.ts +2 -2
  109. package/file-stream/streamable-file.js +26 -28
  110. package/index.d.ts +10 -10
  111. package/index.js +11 -17
  112. package/interfaces/abstract.interface.js +1 -2
  113. package/interfaces/controllers/controller-metadata.interface.js +1 -2
  114. package/interfaces/controllers/controller.interface.js +1 -2
  115. package/interfaces/controllers/index.d.ts +2 -2
  116. package/interfaces/controllers/index.js +2 -5
  117. package/interfaces/exceptions/exception-filter-metadata.interface.d.ts +2 -2
  118. package/interfaces/exceptions/exception-filter-metadata.interface.js +1 -2
  119. package/interfaces/exceptions/exception-filter.interface.d.ts +1 -1
  120. package/interfaces/exceptions/exception-filter.interface.js +1 -2
  121. package/interfaces/exceptions/index.d.ts +5 -5
  122. package/interfaces/exceptions/index.js +5 -8
  123. package/interfaces/exceptions/rpc-exception-filter-metadata.interface.d.ts +2 -2
  124. package/interfaces/exceptions/rpc-exception-filter-metadata.interface.js +1 -2
  125. package/interfaces/exceptions/rpc-exception-filter.interface.d.ts +1 -1
  126. package/interfaces/exceptions/rpc-exception-filter.interface.js +1 -2
  127. package/interfaces/exceptions/ws-exception-filter.interface.d.ts +1 -1
  128. package/interfaces/exceptions/ws-exception-filter.interface.js +1 -2
  129. package/interfaces/external/class-transform-options.interface.js +1 -2
  130. package/interfaces/external/cors-options.interface.js +1 -2
  131. package/interfaces/external/https-options.interface.js +1 -2
  132. package/interfaces/external/transformer-package.interface.d.ts +2 -2
  133. package/interfaces/external/transformer-package.interface.js +1 -2
  134. package/interfaces/external/validation-error.interface.js +1 -2
  135. package/interfaces/external/validator-options.interface.js +1 -2
  136. package/interfaces/external/validator-package.interface.d.ts +2 -2
  137. package/interfaces/external/validator-package.interface.js +1 -2
  138. package/interfaces/features/arguments-host.interface.js +1 -2
  139. package/interfaces/features/can-activate.interface.d.ts +1 -1
  140. package/interfaces/features/can-activate.interface.js +1 -2
  141. package/interfaces/features/custom-route-param-factory.interface.d.ts +1 -1
  142. package/interfaces/features/custom-route-param-factory.interface.js +1 -2
  143. package/interfaces/features/execution-context.interface.d.ts +2 -2
  144. package/interfaces/features/execution-context.interface.js +1 -2
  145. package/interfaces/features/nest-interceptor.interface.d.ts +1 -1
  146. package/interfaces/features/nest-interceptor.interface.js +1 -2
  147. package/interfaces/features/paramtype.interface.js +1 -2
  148. package/interfaces/features/pipe-transform.interface.d.ts +10 -4
  149. package/interfaces/features/pipe-transform.interface.js +1 -2
  150. package/interfaces/global-prefix-options.interface.d.ts +1 -1
  151. package/interfaces/global-prefix-options.interface.js +1 -2
  152. package/interfaces/hooks/before-application-shutdown.interface.js +1 -2
  153. package/interfaces/hooks/index.d.ts +5 -5
  154. package/interfaces/hooks/index.js +5 -8
  155. package/interfaces/hooks/on-application-bootstrap.interface.js +1 -2
  156. package/interfaces/hooks/on-application-shutdown.interface.js +1 -2
  157. package/interfaces/hooks/on-destroy.interface.js +1 -2
  158. package/interfaces/hooks/on-init.interface.js +1 -2
  159. package/interfaces/http/http-exception-body.interface.d.ts +2 -1
  160. package/interfaces/http/http-exception-body.interface.js +1 -2
  161. package/interfaces/http/http-redirect-response.interface.d.ts +1 -1
  162. package/interfaces/http/http-redirect-response.interface.js +1 -2
  163. package/interfaces/http/http-server.interface.d.ts +4 -3
  164. package/interfaces/http/http-server.interface.js +1 -2
  165. package/interfaces/http/index.d.ts +5 -5
  166. package/interfaces/http/index.js +5 -8
  167. package/interfaces/http/message-event.interface.js +1 -2
  168. package/interfaces/http/raw-body-request.interface.js +1 -2
  169. package/interfaces/index.d.ts +31 -30
  170. package/interfaces/index.js +31 -33
  171. package/interfaces/injectable.interface.js +1 -2
  172. package/interfaces/microservices/nest-hybrid-application-options.interface.js +1 -2
  173. package/interfaces/microservices/nest-microservice-options.interface.d.ts +1 -1
  174. package/interfaces/microservices/nest-microservice-options.interface.js +1 -2
  175. package/interfaces/microservices/pre-request-hook.interface.d.ts +22 -0
  176. package/interfaces/microservices/pre-request-hook.interface.js +1 -0
  177. package/interfaces/middleware/index.d.ts +4 -4
  178. package/interfaces/middleware/index.js +4 -7
  179. package/interfaces/middleware/middleware-config-proxy.interface.d.ts +3 -3
  180. package/interfaces/middleware/middleware-config-proxy.interface.js +1 -2
  181. package/interfaces/middleware/middleware-configuration.interface.d.ts +3 -3
  182. package/interfaces/middleware/middleware-configuration.interface.js +1 -2
  183. package/interfaces/middleware/middleware-consumer.interface.d.ts +2 -2
  184. package/interfaces/middleware/middleware-consumer.interface.js +1 -2
  185. package/interfaces/middleware/nest-middleware.interface.js +1 -2
  186. package/interfaces/modules/dynamic-module.interface.d.ts +2 -2
  187. package/interfaces/modules/dynamic-module.interface.js +1 -2
  188. package/interfaces/modules/forward-reference.interface.js +1 -2
  189. package/interfaces/modules/index.d.ts +8 -8
  190. package/interfaces/modules/index.js +8 -11
  191. package/interfaces/modules/injection-token.interface.d.ts +2 -2
  192. package/interfaces/modules/injection-token.interface.js +1 -2
  193. package/interfaces/modules/introspection-result.interface.d.ts +1 -1
  194. package/interfaces/modules/introspection-result.interface.js +1 -2
  195. package/interfaces/modules/module-metadata.interface.d.ts +5 -5
  196. package/interfaces/modules/module-metadata.interface.js +1 -2
  197. package/interfaces/modules/nest-module.interface.d.ts +1 -1
  198. package/interfaces/modules/nest-module.interface.js +1 -2
  199. package/interfaces/modules/optional-factory-dependency.interface.d.ts +1 -1
  200. package/interfaces/modules/optional-factory-dependency.interface.js +1 -2
  201. package/interfaces/modules/provider.interface.d.ts +4 -4
  202. package/interfaces/modules/provider.interface.js +1 -2
  203. package/interfaces/nest-application-context-options.interface.d.ts +1 -1
  204. package/interfaces/nest-application-context-options.interface.js +55 -5
  205. package/interfaces/nest-application-context.interface.d.ts +6 -6
  206. package/interfaces/nest-application-context.interface.js +1 -2
  207. package/interfaces/nest-application-options.interface.d.ts +9 -3
  208. package/interfaces/nest-application-options.interface.js +1 -2
  209. package/interfaces/nest-application.interface.d.ts +8 -8
  210. package/interfaces/nest-application.interface.js +1 -2
  211. package/interfaces/nest-microservice.interface.d.ts +15 -6
  212. package/interfaces/nest-microservice.interface.js +1 -2
  213. package/interfaces/scope-options.interface.js +2 -5
  214. package/interfaces/shutdown-hooks-options.interface.js +1 -2
  215. package/interfaces/type.interface.js +1 -2
  216. package/interfaces/version-options.interface.d.ts +1 -1
  217. package/interfaces/version-options.interface.js +1 -4
  218. package/interfaces/websockets/web-socket-adapter.interface.js +1 -2
  219. package/internal.d.ts +30 -0
  220. package/internal.js +19 -0
  221. package/module-utils/configurable-module.builder.d.ts +4 -4
  222. package/module-utils/configurable-module.builder.js +21 -20
  223. package/module-utils/constants.js +5 -8
  224. package/module-utils/index.d.ts +2 -2
  225. package/module-utils/index.js +2 -5
  226. package/module-utils/interfaces/configurable-module-async-options.interface.d.ts +2 -2
  227. package/module-utils/interfaces/configurable-module-async-options.interface.js +1 -2
  228. package/module-utils/interfaces/configurable-module-cls.interface.d.ts +3 -3
  229. package/module-utils/interfaces/configurable-module-cls.interface.js +1 -2
  230. package/module-utils/interfaces/configurable-module-host.interface.d.ts +2 -2
  231. package/module-utils/interfaces/configurable-module-host.interface.js +1 -2
  232. package/module-utils/interfaces/index.d.ts +3 -3
  233. package/module-utils/interfaces/index.js +3 -6
  234. package/module-utils/utils/generate-options-injection-token.util.js +3 -6
  235. package/module-utils/utils/get-injection-providers.util.d.ts +1 -1
  236. package/module-utils/utils/get-injection-providers.util.js +4 -7
  237. package/module-utils/utils/index.d.ts +2 -2
  238. package/module-utils/utils/index.js +2 -5
  239. package/package.json +35 -2
  240. package/pipes/default-value.pipe.d.ts +1 -1
  241. package/pipes/default-value.pipe.js +10 -12
  242. package/pipes/file/file-type.validator.d.ts +3 -3
  243. package/pipes/file/file-type.validator.js +5 -19
  244. package/pipes/file/file-validator-context.interface.d.ts +1 -1
  245. package/pipes/file/file-validator-context.interface.js +1 -2
  246. package/pipes/file/file-validator.interface.d.ts +1 -1
  247. package/pipes/file/file-validator.interface.js +2 -5
  248. package/pipes/file/index.d.ts +6 -6
  249. package/pipes/file/index.js +6 -9
  250. package/pipes/file/interfaces/file.interface.js +1 -2
  251. package/pipes/file/interfaces/index.d.ts +1 -1
  252. package/pipes/file/interfaces/index.js +1 -4
  253. package/pipes/file/max-file-size.validator.d.ts +3 -3
  254. package/pipes/file/max-file-size.validator.js +2 -6
  255. package/pipes/file/parse-file-options.interface.d.ts +2 -2
  256. package/pipes/file/parse-file-options.interface.js +1 -2
  257. package/pipes/file/parse-file-pipe.builder.d.ts +5 -5
  258. package/pipes/file/parse-file-pipe.builder.js +8 -14
  259. package/pipes/file/parse-file.pipe.d.ts +7 -7
  260. package/pipes/file/parse-file.pipe.js +17 -18
  261. package/pipes/index.d.ts +11 -10
  262. package/pipes/index.js +11 -13
  263. package/pipes/parse-array.pipe.d.ts +4 -4
  264. package/pipes/parse-array.pipe.js +23 -23
  265. package/pipes/parse-bool.pipe.d.ts +6 -6
  266. package/pipes/parse-bool.pipe.js +16 -17
  267. package/pipes/parse-date.pipe.d.ts +4 -4
  268. package/pipes/parse-date.pipe.js +17 -16
  269. package/pipes/parse-enum.pipe.d.ts +5 -5
  270. package/pipes/parse-enum.pipe.js +16 -16
  271. package/pipes/parse-float.pipe.d.ts +6 -6
  272. package/pipes/parse-float.pipe.js +17 -18
  273. package/pipes/parse-int.pipe.d.ts +5 -5
  274. package/pipes/parse-int.pipe.js +18 -19
  275. package/pipes/parse-uuid.pipe.d.ts +4 -4
  276. package/pipes/parse-uuid.pipe.js +27 -26
  277. package/pipes/standard-schema-validation.pipe.d.ts +86 -0
  278. package/pipes/standard-schema-validation.pipe.js +120 -0
  279. package/pipes/validation.pipe.d.ts +32 -14
  280. package/pipes/validation.pipe.js +60 -30
  281. package/serializer/class-serializer.constants.js +1 -4
  282. package/serializer/class-serializer.interceptor.d.ts +5 -5
  283. package/serializer/class-serializer.interceptor.js +21 -24
  284. package/serializer/class-serializer.interfaces.d.ts +2 -2
  285. package/serializer/class-serializer.interfaces.js +1 -2
  286. package/serializer/decorators/index.d.ts +1 -1
  287. package/serializer/decorators/index.js +1 -4
  288. package/serializer/decorators/serialize-options.decorator.d.ts +3 -2
  289. package/serializer/decorators/serialize-options.decorator.js +3 -7
  290. package/serializer/index.d.ts +5 -3
  291. package/serializer/index.js +5 -6
  292. package/serializer/standard-schema-serializer.interceptor.d.ts +50 -0
  293. package/serializer/standard-schema-serializer.interceptor.js +75 -0
  294. package/serializer/standard-schema-serializer.interfaces.d.ts +18 -0
  295. package/serializer/standard-schema-serializer.interfaces.js +1 -0
  296. package/services/console-logger.service.d.ts +22 -3
  297. package/services/console-logger.service.js +132 -66
  298. package/services/index.d.ts +3 -3
  299. package/services/index.js +3 -6
  300. package/services/logger.service.js +86 -83
  301. package/services/utils/filter-log-levels.util.d.ts +1 -1
  302. package/services/utils/filter-log-levels.util.js +7 -10
  303. package/services/utils/index.d.ts +3 -3
  304. package/services/utils/index.js +3 -6
  305. package/services/utils/is-log-level-enabled.util.d.ts +1 -1
  306. package/services/utils/is-log-level-enabled.util.js +1 -4
  307. package/services/utils/is-log-level.util.d.ts +1 -1
  308. package/services/utils/is-log-level.util.js +3 -6
  309. package/tsconfig.build.json +1 -2
  310. package/utils/assign-custom-metadata.util.d.ts +5 -4
  311. package/utils/assign-custom-metadata.util.js +4 -6
  312. package/utils/cli-colors.util.js +4 -8
  313. package/utils/extend-metadata.util.js +1 -4
  314. package/utils/forward-ref.util.d.ts +1 -1
  315. package/utils/forward-ref.util.js +1 -5
  316. package/utils/http-error-by-code.util.d.ts +2 -2
  317. package/utils/http-error-by-code.util.js +22 -25
  318. package/utils/index.d.ts +1 -1
  319. package/utils/index.js +1 -4
  320. package/utils/load-package.util.d.ts +21 -1
  321. package/utils/load-package.util.js +62 -8
  322. package/utils/merge-with-values.util.js +1 -5
  323. package/utils/random-string-generator.util.js +2 -6
  324. package/utils/select-exception-filter-metadata.util.d.ts +1 -1
  325. package/utils/select-exception-filter-metadata.util.js +1 -5
  326. package/utils/shared.utils.d.ts +11 -10
  327. package/utils/shared.utils.js +28 -30
  328. package/utils/validate-each.util.js +3 -7
  329. package/utils/validate-module-keys.util.js +8 -13
@@ -1,3 +1,3 @@
1
- export * from './filter-log-levels.util';
2
- export * from './is-log-level-enabled.util';
3
- export * from './is-log-level.util';
1
+ export * from './filter-log-levels.util.js';
2
+ export * from './is-log-level-enabled.util.js';
3
+ export * from './is-log-level.util.js';
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./filter-log-levels.util"), exports);
5
- tslib_1.__exportStar(require("./is-log-level-enabled.util"), exports);
6
- tslib_1.__exportStar(require("./is-log-level.util"), exports);
1
+ export * from './filter-log-levels.util.js';
2
+ export * from './is-log-level-enabled.util.js';
3
+ export * from './is-log-level.util.js';
@@ -1,4 +1,4 @@
1
- import { LogLevel } from '../logger.service';
1
+ import { LogLevel } from '../logger.service.js';
2
2
  /**
3
3
  * Checks if target level is enabled.
4
4
  * @param targetLevel target level
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLogLevelEnabled = isLogLevelEnabled;
4
1
  const LOG_LEVEL_VALUES = {
5
2
  verbose: 0,
6
3
  debug: 1,
@@ -14,7 +11,7 @@ const LOG_LEVEL_VALUES = {
14
11
  * @param targetLevel target level
15
12
  * @param logLevels array of enabled log levels
16
13
  */
17
- function isLogLevelEnabled(targetLevel, logLevels) {
14
+ export function isLogLevelEnabled(targetLevel, logLevels) {
18
15
  if (!logLevels || (Array.isArray(logLevels) && logLevels?.length === 0)) {
19
16
  return false;
20
17
  }
@@ -1,4 +1,4 @@
1
- import { LogLevel } from '../logger.service';
1
+ import { LogLevel } from '../logger.service.js';
2
2
  /**
3
3
  * @publicApi
4
4
  */
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isLogLevel = isLogLevel;
4
- const logger_service_1 = require("../logger.service");
1
+ import { LOG_LEVELS } from '../logger.service.js';
5
2
  /**
6
3
  * @publicApi
7
4
  */
8
- function isLogLevel(maybeLogLevel) {
9
- return logger_service_1.LOG_LEVELS.includes(maybeLogLevel);
5
+ export function isLogLevel(maybeLogLevel) {
6
+ return LOG_LEVELS.includes(maybeLogLevel);
10
7
  }
@@ -2,8 +2,7 @@
2
2
  "extends": "../tsconfig.build.json",
3
3
  "compilerOptions": {
4
4
  "outDir": ".",
5
- "rootDir": ".",
6
- "paths": {}
5
+ "rootDir": "."
7
6
  },
8
7
  "exclude": ["node_modules", "dist", "test/**/*", "*.spec.ts"],
9
8
  "references": []
@@ -1,4 +1,5 @@
1
- import { ParamData, RouteParamMetadata } from '../decorators/http/route-params.decorator';
2
- import { PipeTransform, Type } from '../interfaces';
3
- import { CustomParamFactory } from '../interfaces/features/custom-route-param-factory.interface';
4
- export declare function assignCustomParameterMetadata(args: Record<number, RouteParamMetadata>, paramtype: number | string, index: number, factory: CustomParamFactory, data?: ParamData, ...pipes: (Type<PipeTransform> | PipeTransform)[]): {};
1
+ import type { StandardSchemaV1 } from '@standard-schema/spec';
2
+ import { ParamData, RouteParamMetadata } from '../decorators/http/route-params.decorator.js';
3
+ import { CustomParamFactory } from '../interfaces/features/custom-route-param-factory.interface.js';
4
+ import { PipeTransform, Type } from '../interfaces/index.js';
5
+ export declare function assignCustomParameterMetadata(args: Record<number, RouteParamMetadata>, paramtype: number | string, index: number, factory: CustomParamFactory, data?: ParamData, schema?: StandardSchemaV1, ...pipes: (Type<PipeTransform> | PipeTransform)[]): {};
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assignCustomParameterMetadata = assignCustomParameterMetadata;
4
- const constants_1 = require("../constants");
5
- function assignCustomParameterMetadata(args, paramtype, index, factory, data, ...pipes) {
1
+ import { CUSTOM_ROUTE_ARGS_METADATA } from '../constants.js';
2
+ export function assignCustomParameterMetadata(args, paramtype, index, factory, data, schema, ...pipes) {
6
3
  return {
7
4
  ...args,
8
- [`${paramtype}${constants_1.CUSTOM_ROUTE_ARGS_METADATA}:${index}`]: {
5
+ [`${paramtype}${CUSTOM_ROUTE_ARGS_METADATA}:${index}`]: {
9
6
  index,
10
7
  factory,
11
8
  data,
12
9
  pipes,
10
+ ...(schema !== undefined && { schema }),
13
11
  },
14
12
  };
15
13
  }
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.yellow = exports.clc = exports.isColorAllowed = void 0;
4
- const isColorAllowed = () => !process.env.NO_COLOR;
5
- exports.isColorAllowed = isColorAllowed;
6
- const colorIfAllowed = (colorFn) => (text) => (0, exports.isColorAllowed)() ? colorFn(text) : text;
7
- exports.clc = {
1
+ export const isColorAllowed = () => !process.env.NO_COLOR;
2
+ const colorIfAllowed = (colorFn) => (text) => isColorAllowed() ? colorFn(text) : text;
3
+ export const clc = {
8
4
  bold: colorIfAllowed((text) => `\x1B[1m${text}\x1B[0m`),
9
5
  green: colorIfAllowed((text) => `\x1B[32m${text}\x1B[39m`),
10
6
  yellow: colorIfAllowed((text) => `\x1B[33m${text}\x1B[39m`),
@@ -12,4 +8,4 @@ exports.clc = {
12
8
  magentaBright: colorIfAllowed((text) => `\x1B[95m${text}\x1B[39m`),
13
9
  cyanBright: colorIfAllowed((text) => `\x1B[96m${text}\x1B[39m`),
14
10
  };
15
- exports.yellow = colorIfAllowed((text) => `\x1B[38;5;3m${text}\x1B[39m`);
11
+ export const yellow = colorIfAllowed((text) => `\x1B[38;5;3m${text}\x1B[39m`);
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extendArrayMetadata = extendArrayMetadata;
4
- function extendArrayMetadata(key, metadata, target) {
1
+ export function extendArrayMetadata(key, metadata, target) {
5
2
  const previousValue = Reflect.getMetadata(key, target) || [];
6
3
  const value = [...previousValue, ...metadata];
7
4
  Reflect.defineMetadata(key, value, target);
@@ -1,4 +1,4 @@
1
- import { ForwardReference } from '../interfaces/modules/forward-reference.interface';
1
+ import { ForwardReference } from '../interfaces/modules/forward-reference.interface.js';
2
2
  /**
3
3
  * @publicApi
4
4
  */
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forwardRef = void 0;
4
1
  /**
5
2
  * @publicApi
6
3
  */
7
- const forwardRef = (fn) => ({
4
+ export const forwardRef = (fn) => ({
8
5
  forwardRef: fn,
9
6
  });
10
- exports.forwardRef = forwardRef;
@@ -1,4 +1,4 @@
1
- import { HttpStatus } from '../enums';
2
- import { Type } from '../interfaces';
1
+ import { HttpStatus } from '../enums/index.js';
2
+ import { Type } from '../interfaces/index.js';
3
3
  export type ErrorHttpStatusCode = HttpStatus.BAD_GATEWAY | HttpStatus.BAD_REQUEST | HttpStatus.CONFLICT | HttpStatus.FORBIDDEN | HttpStatus.GATEWAY_TIMEOUT | HttpStatus.GONE | HttpStatus.I_AM_A_TEAPOT | HttpStatus.INTERNAL_SERVER_ERROR | HttpStatus.METHOD_NOT_ALLOWED | HttpStatus.NOT_ACCEPTABLE | HttpStatus.NOT_FOUND | HttpStatus.NOT_IMPLEMENTED | HttpStatus.PAYLOAD_TOO_LARGE | HttpStatus.PRECONDITION_FAILED | HttpStatus.REQUEST_TIMEOUT | HttpStatus.SERVICE_UNAVAILABLE | HttpStatus.UNAUTHORIZED | HttpStatus.UNPROCESSABLE_ENTITY | HttpStatus.UNSUPPORTED_MEDIA_TYPE;
4
4
  export declare const HttpErrorByCode: Record<ErrorHttpStatusCode, Type<unknown>>;
@@ -1,26 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpErrorByCode = void 0;
4
- const enums_1 = require("../enums");
5
- const exceptions_1 = require("../exceptions");
6
- exports.HttpErrorByCode = {
7
- [enums_1.HttpStatus.BAD_GATEWAY]: exceptions_1.BadGatewayException,
8
- [enums_1.HttpStatus.BAD_REQUEST]: exceptions_1.BadRequestException,
9
- [enums_1.HttpStatus.CONFLICT]: exceptions_1.ConflictException,
10
- [enums_1.HttpStatus.FORBIDDEN]: exceptions_1.ForbiddenException,
11
- [enums_1.HttpStatus.GATEWAY_TIMEOUT]: exceptions_1.GatewayTimeoutException,
12
- [enums_1.HttpStatus.GONE]: exceptions_1.GoneException,
13
- [enums_1.HttpStatus.I_AM_A_TEAPOT]: exceptions_1.ImATeapotException,
14
- [enums_1.HttpStatus.INTERNAL_SERVER_ERROR]: exceptions_1.InternalServerErrorException,
15
- [enums_1.HttpStatus.METHOD_NOT_ALLOWED]: exceptions_1.MethodNotAllowedException,
16
- [enums_1.HttpStatus.NOT_ACCEPTABLE]: exceptions_1.NotAcceptableException,
17
- [enums_1.HttpStatus.NOT_FOUND]: exceptions_1.NotFoundException,
18
- [enums_1.HttpStatus.NOT_IMPLEMENTED]: exceptions_1.NotImplementedException,
19
- [enums_1.HttpStatus.PAYLOAD_TOO_LARGE]: exceptions_1.PayloadTooLargeException,
20
- [enums_1.HttpStatus.PRECONDITION_FAILED]: exceptions_1.PreconditionFailedException,
21
- [enums_1.HttpStatus.REQUEST_TIMEOUT]: exceptions_1.RequestTimeoutException,
22
- [enums_1.HttpStatus.SERVICE_UNAVAILABLE]: exceptions_1.ServiceUnavailableException,
23
- [enums_1.HttpStatus.UNAUTHORIZED]: exceptions_1.UnauthorizedException,
24
- [enums_1.HttpStatus.UNPROCESSABLE_ENTITY]: exceptions_1.UnprocessableEntityException,
25
- [enums_1.HttpStatus.UNSUPPORTED_MEDIA_TYPE]: exceptions_1.UnsupportedMediaTypeException,
1
+ import { HttpStatus } from '../enums/index.js';
2
+ import { BadGatewayException, BadRequestException, ConflictException, ForbiddenException, GatewayTimeoutException, GoneException, ImATeapotException, InternalServerErrorException, MethodNotAllowedException, NotAcceptableException, NotFoundException, NotImplementedException, PayloadTooLargeException, PreconditionFailedException, RequestTimeoutException, ServiceUnavailableException, UnauthorizedException, UnprocessableEntityException, UnsupportedMediaTypeException, } from '../exceptions/index.js';
3
+ export const HttpErrorByCode = {
4
+ [HttpStatus.BAD_GATEWAY]: BadGatewayException,
5
+ [HttpStatus.BAD_REQUEST]: BadRequestException,
6
+ [HttpStatus.CONFLICT]: ConflictException,
7
+ [HttpStatus.FORBIDDEN]: ForbiddenException,
8
+ [HttpStatus.GATEWAY_TIMEOUT]: GatewayTimeoutException,
9
+ [HttpStatus.GONE]: GoneException,
10
+ [HttpStatus.I_AM_A_TEAPOT]: ImATeapotException,
11
+ [HttpStatus.INTERNAL_SERVER_ERROR]: InternalServerErrorException,
12
+ [HttpStatus.METHOD_NOT_ALLOWED]: MethodNotAllowedException,
13
+ [HttpStatus.NOT_ACCEPTABLE]: NotAcceptableException,
14
+ [HttpStatus.NOT_FOUND]: NotFoundException,
15
+ [HttpStatus.NOT_IMPLEMENTED]: NotImplementedException,
16
+ [HttpStatus.PAYLOAD_TOO_LARGE]: PayloadTooLargeException,
17
+ [HttpStatus.PRECONDITION_FAILED]: PreconditionFailedException,
18
+ [HttpStatus.REQUEST_TIMEOUT]: RequestTimeoutException,
19
+ [HttpStatus.SERVICE_UNAVAILABLE]: ServiceUnavailableException,
20
+ [HttpStatus.UNAUTHORIZED]: UnauthorizedException,
21
+ [HttpStatus.UNPROCESSABLE_ENTITY]: UnprocessableEntityException,
22
+ [HttpStatus.UNSUPPORTED_MEDIA_TYPE]: UnsupportedMediaTypeException,
26
23
  };
package/utils/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './forward-ref.util';
1
+ export * from './forward-ref.util.js';
package/utils/index.js CHANGED
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./forward-ref.util"), exports);
1
+ export * from './forward-ref.util.js';
@@ -1 +1,21 @@
1
- export declare function loadPackage(packageName: string, context: string, loaderFn?: Function): any;
1
+ export declare function loadPackage(packageName: string, context: string, loaderFn?: Function): Promise<any>;
2
+ /**
3
+ * Synchronously loads a package using `createRequire` and caches it.
4
+ * This is meant for optional dependencies that must be loaded in
5
+ * synchronous contexts (e.g. constructors).
6
+ *
7
+ * @param loaderFn Optional synchronous loader (e.g.
8
+ * `() => createRequire(import.meta.url)('pkg')`).
9
+ * When provided, bundlers can statically analyse the string literal.
10
+ * Falls back to a `createRequire` call resolved from this file.
11
+ */
12
+ export declare function loadPackageSync(packageName: string, context: string, loaderFn?: () => any): any;
13
+ /**
14
+ * Synchronously returns a package that was previously loaded and cached
15
+ * via {@link loadPackage}. Throws if the package has not been loaded yet.
16
+ *
17
+ * Use this in methods that must remain synchronous (e.g. `connectMicroservice`).
18
+ * Ensure that `loadPackage()` has been `await`ed for the same package name
19
+ * before calling this function (typically during `init()` or `compile()`).
20
+ */
21
+ export declare function loadPackageCached(packageName: string): any;
@@ -1,16 +1,70 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadPackage = loadPackage;
4
- const logger_service_1 = require("../services/logger.service");
1
+ import { createRequire } from 'module';
2
+ import { Logger } from '../services/logger.service.js';
5
3
  const MISSING_REQUIRED_DEPENDENCY = (name, reason) => `The "${name}" package is missing. Please, make sure to install it to take advantage of ${reason}.`;
6
- const logger = new logger_service_1.Logger('PackageLoader');
7
- function loadPackage(packageName, context, loaderFn) {
4
+ const logger = new Logger('PackageLoader');
5
+ /**
6
+ * Cache of already-loaded packages keyed by package name.
7
+ * Allows subsequent calls (including synchronous ones) to
8
+ * return the module without another async import().
9
+ */
10
+ const packageCache = new Map();
11
+ export async function loadPackage(packageName, context, loaderFn) {
12
+ const cached = packageCache.get(packageName);
13
+ if (cached) {
14
+ return cached;
15
+ }
8
16
  try {
9
- return loaderFn ? loaderFn() : require(packageName);
17
+ const pkg = loaderFn ? await loaderFn() : await import(packageName);
18
+ packageCache.set(packageName, pkg);
19
+ return pkg;
10
20
  }
11
21
  catch (e) {
12
22
  logger.error(MISSING_REQUIRED_DEPENDENCY(packageName, context));
13
- logger_service_1.Logger.flush();
23
+ Logger.flush();
14
24
  process.exit(1);
15
25
  }
16
26
  }
27
+ /**
28
+ * Synchronously loads a package using `createRequire` and caches it.
29
+ * This is meant for optional dependencies that must be loaded in
30
+ * synchronous contexts (e.g. constructors).
31
+ *
32
+ * @param loaderFn Optional synchronous loader (e.g.
33
+ * `() => createRequire(import.meta.url)('pkg')`).
34
+ * When provided, bundlers can statically analyse the string literal.
35
+ * Falls back to a `createRequire` call resolved from this file.
36
+ */
37
+ export function loadPackageSync(packageName, context, loaderFn) {
38
+ const cached = packageCache.get(packageName);
39
+ if (cached) {
40
+ return cached;
41
+ }
42
+ try {
43
+ const pkg = loaderFn
44
+ ? loaderFn()
45
+ : createRequire(import.meta.url)(packageName);
46
+ packageCache.set(packageName, pkg);
47
+ return pkg;
48
+ }
49
+ catch (e) {
50
+ logger.error(MISSING_REQUIRED_DEPENDENCY(packageName, context));
51
+ Logger.flush();
52
+ process.exit(1);
53
+ }
54
+ }
55
+ /**
56
+ * Synchronously returns a package that was previously loaded and cached
57
+ * via {@link loadPackage}. Throws if the package has not been loaded yet.
58
+ *
59
+ * Use this in methods that must remain synchronous (e.g. `connectMicroservice`).
60
+ * Ensure that `loadPackage()` has been `await`ed for the same package name
61
+ * before calling this function (typically during `init()` or `compile()`).
62
+ */
63
+ export function loadPackageCached(packageName) {
64
+ const cached = packageCache.get(packageName);
65
+ if (!cached) {
66
+ throw new Error(`Package "${packageName}" has not been loaded yet. ` +
67
+ `Ensure loadPackage("${packageName}", ...) has been awaited before calling loadPackageCached.`);
68
+ }
69
+ return cached;
70
+ }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MergeWithValues = void 0;
4
1
  /* eslint-disable @typescript-eslint/no-empty-object-type */
5
- const MergeWithValues = (data) => {
2
+ export const MergeWithValues = (data) => {
6
3
  return (Metatype) => {
7
4
  const Type = class extends Metatype {
8
5
  constructor(...args) {
@@ -15,4 +12,3 @@ const MergeWithValues = (data) => {
15
12
  return Type;
16
13
  };
17
14
  };
18
- exports.MergeWithValues = MergeWithValues;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomStringGenerator = void 0;
4
- const uid_1 = require("uid");
5
- const randomStringGenerator = () => (0, uid_1.uid)(21);
6
- exports.randomStringGenerator = randomStringGenerator;
1
+ import { uid } from 'uid';
2
+ export const randomStringGenerator = () => uid(21);
@@ -1,2 +1,2 @@
1
- import { ExceptionFilterMetadata } from '../interfaces/exceptions';
1
+ import { ExceptionFilterMetadata } from '../interfaces/exceptions/index.js';
2
2
  export declare const selectExceptionFilterMetadata: <T = any>(filters: ExceptionFilterMetadata[], exception: T) => ExceptionFilterMetadata | undefined;
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectExceptionFilterMetadata = void 0;
4
- const selectExceptionFilterMetadata = (filters, exception) => filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length ||
1
+ export const selectExceptionFilterMetadata = (filters, exception) => filters.find(({ exceptionMetatypes }) => !exceptionMetatypes.length ||
5
2
  exceptionMetatypes.some(ExceptionMetaType => exception instanceof ExceptionMetaType));
6
- exports.selectExceptionFilterMetadata = selectExceptionFilterMetadata;
@@ -1,13 +1,14 @@
1
- export declare const isUndefined: (obj: any) => obj is undefined;
2
- export declare const isObject: (fn: any) => fn is object;
3
- export declare const isPlainObject: (fn: any) => fn is object;
1
+ export declare const isUndefined: (obj: unknown) => obj is undefined;
2
+ export declare const isObject: (fn: unknown) => fn is object;
3
+ export declare const isPlainObject: (fn: unknown) => fn is object;
4
4
  export declare const addLeadingSlash: (path?: string) => string;
5
5
  export declare const normalizePath: (path?: string) => string;
6
6
  export declare const stripEndSlash: (path: string) => string;
7
- export declare const isFunction: (val: any) => val is Function;
8
- export declare const isString: (val: any) => val is string;
9
- export declare const isNumber: (val: any) => val is number;
10
- export declare const isConstructor: (val: any) => boolean;
11
- export declare const isNil: (val: any) => val is null | undefined;
12
- export declare const isEmpty: (array: any) => boolean;
13
- export declare const isSymbol: (val: any) => val is symbol;
7
+ export declare const isFunction: (val: unknown) => val is Function;
8
+ export declare const isString: (val: unknown) => val is string;
9
+ export declare const isNumber: (val: unknown) => val is number;
10
+ export declare const isConstructor: (val: unknown) => boolean;
11
+ export declare const isNil: (val: unknown) => val is null | undefined;
12
+ export declare const isEmpty: (value: unknown) => boolean;
13
+ export declare const isEmptyArray: (array: unknown) => boolean;
14
+ export declare const isSymbol: (val: unknown) => val is symbol;
@@ -1,12 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSymbol = exports.isEmpty = exports.isNil = exports.isConstructor = exports.isNumber = exports.isString = exports.isFunction = exports.stripEndSlash = exports.normalizePath = exports.addLeadingSlash = exports.isPlainObject = exports.isObject = exports.isUndefined = void 0;
4
- const isUndefined = (obj) => typeof obj === 'undefined';
5
- exports.isUndefined = isUndefined;
6
- const isObject = (fn) => !(0, exports.isNil)(fn) && typeof fn === 'object';
7
- exports.isObject = isObject;
8
- const isPlainObject = (fn) => {
9
- if (!(0, exports.isObject)(fn)) {
1
+ export const isUndefined = (obj) => typeof obj === 'undefined';
2
+ export const isObject = (fn) => !isNil(fn) && typeof fn === 'object';
3
+ export const isPlainObject = (fn) => {
4
+ if (!isObject(fn)) {
10
5
  return false;
11
6
  }
12
7
  const proto = Object.getPrototypeOf(fn);
@@ -20,32 +15,35 @@ const isPlainObject = (fn) => {
20
15
  Function.prototype.toString.call(ctor) ===
21
16
  Function.prototype.toString.call(Object));
22
17
  };
23
- exports.isPlainObject = isPlainObject;
24
- const addLeadingSlash = (path) => path && typeof path === 'string'
18
+ export const addLeadingSlash = (path) => path && typeof path === 'string'
25
19
  ? path.charAt(0) !== '/' && path.substring(0, 2) !== '{/'
26
20
  ? '/' + path
27
21
  : path
28
22
  : '';
29
- exports.addLeadingSlash = addLeadingSlash;
30
- const normalizePath = (path) => path
23
+ export const normalizePath = (path) => path
31
24
  ? path.startsWith('/')
32
25
  ? ('/' + path.replace(/\/+$/, '')).replace(/\/+/g, '/')
33
26
  : '/' + path.replace(/\/+$/, '')
34
27
  : '/';
35
- exports.normalizePath = normalizePath;
36
- const stripEndSlash = (path) => path[path.length - 1] === '/' ? path.slice(0, path.length - 1) : path;
37
- exports.stripEndSlash = stripEndSlash;
38
- const isFunction = (val) => typeof val === 'function';
39
- exports.isFunction = isFunction;
40
- const isString = (val) => typeof val === 'string';
41
- exports.isString = isString;
42
- const isNumber = (val) => typeof val === 'number';
43
- exports.isNumber = isNumber;
44
- const isConstructor = (val) => val === 'constructor';
45
- exports.isConstructor = isConstructor;
46
- const isNil = (val) => (0, exports.isUndefined)(val) || val === null;
47
- exports.isNil = isNil;
48
- const isEmpty = (array) => !(array && array.length > 0);
49
- exports.isEmpty = isEmpty;
50
- const isSymbol = (val) => typeof val === 'symbol';
51
- exports.isSymbol = isSymbol;
28
+ export const stripEndSlash = (path) => path.endsWith('/') ? path.slice(0, -1) : path;
29
+ export const isFunction = (val) => typeof val === 'function';
30
+ export const isString = (val) => typeof val === 'string';
31
+ export const isNumber = (val) => typeof val === 'number';
32
+ export const isConstructor = (val) => val === 'constructor';
33
+ export const isNil = (val) => isUndefined(val) || val === null;
34
+ export const isEmpty = (value) => {
35
+ if (isNil(value)) {
36
+ return true;
37
+ }
38
+ if (Array.isArray(value)) {
39
+ return value.length === 0;
40
+ }
41
+ return false;
42
+ };
43
+ export const isEmptyArray = (array) => {
44
+ if (!Array.isArray(array)) {
45
+ return false;
46
+ }
47
+ return array.length === 0;
48
+ };
49
+ export const isSymbol = (val) => typeof val === 'symbol';
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvalidDecoratorItemException = void 0;
4
- exports.validateEach = validateEach;
5
- class InvalidDecoratorItemException extends Error {
1
+ export class InvalidDecoratorItemException extends Error {
2
+ msg;
6
3
  constructor(decorator, item, context) {
7
4
  const message = `Invalid ${item} passed to ${decorator}() decorator (${context}).`;
8
5
  super(message);
@@ -12,8 +9,7 @@ class InvalidDecoratorItemException extends Error {
12
9
  return this.msg;
13
10
  }
14
11
  }
15
- exports.InvalidDecoratorItemException = InvalidDecoratorItemException;
16
- function validateEach(context, arr, predicate, decorator, item) {
12
+ export function validateEach(context, arr, predicate, decorator, item) {
17
13
  if (!context || !context.name) {
18
14
  return true;
19
15
  }
@@ -1,22 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INVALID_MODULE_CONFIG_MESSAGE = void 0;
4
- exports.validateModuleKeys = validateModuleKeys;
5
- const constants_1 = require("../constants");
6
- const INVALID_MODULE_CONFIG_MESSAGE = (text, property) => `Invalid property '${property}' passed into the @Module() decorator.`;
7
- exports.INVALID_MODULE_CONFIG_MESSAGE = INVALID_MODULE_CONFIG_MESSAGE;
1
+ import { MODULE_METADATA as metadataConstants } from '../constants.js';
2
+ export const INVALID_MODULE_CONFIG_MESSAGE = (text, property) => `Invalid property '${property}' passed into the @Module() decorator.`;
8
3
  const metadataKeys = [
9
- constants_1.MODULE_METADATA.IMPORTS,
10
- constants_1.MODULE_METADATA.EXPORTS,
11
- constants_1.MODULE_METADATA.CONTROLLERS,
12
- constants_1.MODULE_METADATA.PROVIDERS,
4
+ metadataConstants.IMPORTS,
5
+ metadataConstants.EXPORTS,
6
+ metadataConstants.CONTROLLERS,
7
+ metadataConstants.PROVIDERS,
13
8
  ];
14
- function validateModuleKeys(keys) {
9
+ export function validateModuleKeys(keys) {
15
10
  const validateKey = (key) => {
16
11
  if (metadataKeys.includes(key)) {
17
12
  return;
18
13
  }
19
- throw new Error((0, exports.INVALID_MODULE_CONFIG_MESSAGE) `${key}`);
14
+ throw new Error(INVALID_MODULE_CONFIG_MESSAGE `${key}`);
20
15
  };
21
16
  keys.forEach(validateKey);
22
17
  }