@nestjs/core 8.3.0 → 8.3.1

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 (78) hide show
  1. package/Readme.md +1 -0
  2. package/adapters/index.js +1 -1
  3. package/discovery/discovery-module.js +2 -2
  4. package/discovery/discovery-service.js +5 -5
  5. package/discovery/index.js +2 -2
  6. package/errors/exceptions/invalid-class-module.exception.js +1 -1
  7. package/errors/exceptions/invalid-class-scope.exception.js +2 -2
  8. package/errors/exceptions/invalid-class.exception.js +1 -1
  9. package/errors/exceptions/invalid-middleware.exception.js +1 -1
  10. package/errors/exceptions/invalid-module.exception.js +1 -1
  11. package/errors/exceptions/undefined-dependency.exception.js +1 -1
  12. package/errors/exceptions/undefined-forwardref.exception.js +1 -1
  13. package/errors/exceptions/undefined-module.exception.js +1 -1
  14. package/errors/exceptions/unknown-dependencies.exception.js +1 -1
  15. package/errors/exceptions/unknown-export.exception.js +1 -1
  16. package/errors/messages.js +3 -3
  17. package/exceptions/base-exception-filter-context.js +3 -3
  18. package/exceptions/base-exception-filter.js +6 -6
  19. package/exceptions/exceptions-handler.js +1 -1
  20. package/exceptions/external-exception-filter-context.js +2 -2
  21. package/exceptions/external-exceptions-handler.js +1 -1
  22. package/exceptions/index.js +1 -1
  23. package/guards/guards-consumer.js +2 -2
  24. package/guards/guards-context-creator.js +4 -4
  25. package/helpers/context-utils.js +1 -1
  26. package/helpers/external-context-creator.js +3 -3
  27. package/helpers/index.js +2 -2
  28. package/helpers/interfaces/index.js +2 -2
  29. package/hooks/before-app-shutdown.hook.js +5 -5
  30. package/hooks/index.js +5 -5
  31. package/hooks/on-app-bootstrap.hook.js +5 -5
  32. package/hooks/on-app-shutdown.hook.js +5 -5
  33. package/hooks/on-module-destroy.hook.js +5 -5
  34. package/hooks/on-module-init.hook.js +5 -5
  35. package/index.js +12 -12
  36. package/injector/compiler.js +1 -1
  37. package/injector/helpers/transient-instances.js +2 -2
  38. package/injector/index.js +5 -5
  39. package/injector/injector.js +13 -13
  40. package/injector/inquirer/index.js +1 -1
  41. package/injector/instance-links-host.js +1 -1
  42. package/injector/instance-loader.js +1 -1
  43. package/injector/instance-wrapper.js +7 -7
  44. package/injector/internal-core-module.js +3 -3
  45. package/injector/module-ref.js +1 -1
  46. package/injector/module-token-factory.js +4 -4
  47. package/injector/module.js +18 -18
  48. package/injector/modules-container.js +1 -1
  49. package/interceptors/interceptors-consumer.js +4 -4
  50. package/interceptors/interceptors-context-creator.js +4 -4
  51. package/metadata-scanner.js +4 -4
  52. package/middleware/builder.js +3 -3
  53. package/middleware/container.js +1 -1
  54. package/middleware/index.js +1 -1
  55. package/middleware/middleware-module.js +6 -6
  56. package/middleware/routes-mapper.js +6 -6
  57. package/middleware/utils.js +6 -6
  58. package/nest-application-context.js +8 -8
  59. package/nest-application.js +13 -13
  60. package/nest-factory.js +6 -6
  61. package/package.json +2 -2
  62. package/pipes/pipes-context-creator.js +4 -4
  63. package/router/index.js +2 -2
  64. package/router/interfaces/index.js +1 -1
  65. package/router/route-path-factory.js +8 -8
  66. package/router/router-exception-filters.js +2 -2
  67. package/router/router-execution-context.js +4 -4
  68. package/router/router-explorer.js +12 -12
  69. package/router/router-module.js +6 -6
  70. package/router/router-response-controller.js +6 -6
  71. package/router/routes-resolver.js +2 -2
  72. package/router/sse-stream.js +1 -1
  73. package/router/utils/exclude-route.util.js +1 -1
  74. package/router/utils/flatten-route-paths.util.js +2 -2
  75. package/router/utils/index.js +2 -2
  76. package/scanner.js +9 -9
  77. package/services/index.js +1 -1
  78. package/services/reflector.service.js +2 -2
package/Readme.md CHANGED
@@ -123,6 +123,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
123
123
  <td align="center" valign="middle"><a href="https://thecasinowizard.com/bonuses/no-deposit-bonuses/" target="_blank"><img src="https://nestjs.com/img/casinowizard-logo.png" width="120" valign="middle" /></a></td></tr><tr>
124
124
  <td align="center" valign="middle"><a href="https://polygon-software.ch/" target="_blank"><img src="https://nestjs.com/img/polygon-logo.svg" width="120" valign="middle" /></a></td>
125
125
  <td align="center" valign="middle"><a href="https://mobilereality.pl/" target="_blank"><img src="https://nestjs.com/img/mobile-reality-logo.png" width="45" valign="middle" /></a></td>
126
+ <td align="center" valign="middle"><a href="https://boringowl.io/" target="_blank"><img src="https://nestjs.com/img/boringowl-logo.svg" width="120" valign="middle" /></a></td>
126
127
  </tr></table>
127
128
 
128
129
  ## Backers
package/adapters/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./http-adapter"), exports);
4
+ tslib_1.__exportStar(require("./http-adapter"), exports);
@@ -10,8 +10,8 @@ const discovery_service_1 = require("./discovery-service");
10
10
  */
11
11
  let DiscoveryModule = class DiscoveryModule {
12
12
  };
13
- DiscoveryModule = (0, tslib_1.__decorate)([
14
- (0, common_1.Module)({
13
+ DiscoveryModule = tslib_1.__decorate([
14
+ common_1.Module({
15
15
  providers: [metadata_scanner_1.MetadataScanner, discovery_service_1.DiscoveryService],
16
16
  exports: [metadata_scanner_1.MetadataScanner, discovery_service_1.DiscoveryService],
17
17
  })
@@ -13,11 +13,11 @@ let DiscoveryService = class DiscoveryService {
13
13
  }
14
14
  getProviders(options = {}, modules = this.getModules(options)) {
15
15
  const providers = modules.map(item => [...item.providers.values()]);
16
- return (0, common_1.flatten)(providers);
16
+ return common_1.flatten(providers);
17
17
  }
18
18
  getControllers(options = {}, modules = this.getModules(options)) {
19
19
  const controllers = modules.map(item => [...item.controllers.values()]);
20
- return (0, common_1.flatten)(controllers);
20
+ return common_1.flatten(controllers);
21
21
  }
22
22
  getModules(options = {}) {
23
23
  if (!options.include) {
@@ -32,8 +32,8 @@ let DiscoveryService = class DiscoveryService {
32
32
  return moduleRefs.filter(({ metatype }) => include.some(item => item === metatype));
33
33
  }
34
34
  };
35
- DiscoveryService = (0, tslib_1.__decorate)([
36
- (0, common_1.Injectable)(),
37
- (0, tslib_1.__metadata)("design:paramtypes", [modules_container_1.ModulesContainer])
35
+ DiscoveryService = tslib_1.__decorate([
36
+ common_1.Injectable(),
37
+ tslib_1.__metadata("design:paramtypes", [modules_container_1.ModulesContainer])
38
38
  ], DiscoveryService);
39
39
  exports.DiscoveryService = DiscoveryService;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./discovery-module"), exports);
5
- (0, tslib_1.__exportStar)(require("./discovery-service"), exports);
4
+ tslib_1.__exportStar(require("./discovery-module"), exports);
5
+ tslib_1.__exportStar(require("./discovery-service"), exports);
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class InvalidClassModuleException extends runtime_exception_1.RuntimeException {
7
7
  constructor(metatypeUsedAsAModule, scope) {
8
- super((0, messages_1.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE)(metatypeUsedAsAModule, scope));
8
+ super(messages_1.USING_INVALID_CLASS_AS_A_MODULE_MESSAGE(metatypeUsedAsAModule, scope));
9
9
  }
10
10
  }
11
11
  exports.InvalidClassModuleException = InvalidClassModuleException;
@@ -6,11 +6,11 @@ const messages_1 = require("../messages");
6
6
  const runtime_exception_1 = require("./runtime.exception");
7
7
  class InvalidClassScopeException extends runtime_exception_1.RuntimeException {
8
8
  constructor(metatypeOrToken) {
9
- let name = (0, shared_utils_1.isFunction)(metatypeOrToken)
9
+ let name = shared_utils_1.isFunction(metatypeOrToken)
10
10
  ? metatypeOrToken.name
11
11
  : metatypeOrToken;
12
12
  name = name && name.toString();
13
- super((0, messages_1.INVALID_CLASS_SCOPE_MESSAGE) `${name}`);
13
+ super(messages_1.INVALID_CLASS_SCOPE_MESSAGE `${name}`);
14
14
  }
15
15
  }
16
16
  exports.InvalidClassScopeException = InvalidClassScopeException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class InvalidClassException extends runtime_exception_1.RuntimeException {
7
7
  constructor(value) {
8
- super((0, messages_1.INVALID_CLASS_MESSAGE) `${value}`);
8
+ super(messages_1.INVALID_CLASS_MESSAGE `${value}`);
9
9
  }
10
10
  }
11
11
  exports.InvalidClassException = InvalidClassException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class InvalidMiddlewareException extends runtime_exception_1.RuntimeException {
7
7
  constructor(name) {
8
- super((0, messages_1.INVALID_MIDDLEWARE_MESSAGE) `${name}`);
8
+ super(messages_1.INVALID_MIDDLEWARE_MESSAGE `${name}`);
9
9
  }
10
10
  }
11
11
  exports.InvalidMiddlewareException = InvalidMiddlewareException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class InvalidModuleException extends runtime_exception_1.RuntimeException {
7
7
  constructor(parentModule, index, scope) {
8
- super((0, messages_1.INVALID_MODULE_MESSAGE)(parentModule, index, scope));
8
+ super(messages_1.INVALID_MODULE_MESSAGE(parentModule, index, scope));
9
9
  }
10
10
  }
11
11
  exports.InvalidModuleException = InvalidModuleException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class UndefinedDependencyException extends runtime_exception_1.RuntimeException {
7
7
  constructor(type, undefinedDependencyContext, module) {
8
- super((0, messages_1.UNKNOWN_DEPENDENCIES_MESSAGE)(type, undefinedDependencyContext, module));
8
+ super(messages_1.UNKNOWN_DEPENDENCIES_MESSAGE(type, undefinedDependencyContext, module));
9
9
  }
10
10
  }
11
11
  exports.UndefinedDependencyException = UndefinedDependencyException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class UndefinedForwardRefException extends runtime_exception_1.RuntimeException {
7
7
  constructor(scope) {
8
- super((0, messages_1.UNDEFINED_FORWARDREF_MESSAGE)(scope));
8
+ super(messages_1.UNDEFINED_FORWARDREF_MESSAGE(scope));
9
9
  }
10
10
  }
11
11
  exports.UndefinedForwardRefException = UndefinedForwardRefException;
@@ -5,7 +5,7 @@ const runtime_exception_1 = require("./runtime.exception");
5
5
  const messages_1 = require("../messages");
6
6
  class UndefinedModuleException extends runtime_exception_1.RuntimeException {
7
7
  constructor(parentModule, index, scope) {
8
- super((0, messages_1.UNDEFINED_MODULE_MESSAGE)(parentModule, index, scope));
8
+ super(messages_1.UNDEFINED_MODULE_MESSAGE(parentModule, index, scope));
9
9
  }
10
10
  }
11
11
  exports.UndefinedModuleException = UndefinedModuleException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class UnknownDependenciesException extends runtime_exception_1.RuntimeException {
7
7
  constructor(type, unknownDependencyContext, module) {
8
- super((0, messages_1.UNKNOWN_DEPENDENCIES_MESSAGE)(type, unknownDependencyContext, module));
8
+ super(messages_1.UNKNOWN_DEPENDENCIES_MESSAGE(type, unknownDependencyContext, module));
9
9
  }
10
10
  }
11
11
  exports.UnknownDependenciesException = UnknownDependenciesException;
@@ -5,7 +5,7 @@ const messages_1 = require("../messages");
5
5
  const runtime_exception_1 = require("./runtime.exception");
6
6
  class UnknownExportException extends runtime_exception_1.RuntimeException {
7
7
  constructor(token, moduleName) {
8
- super((0, messages_1.UNKNOWN_EXPORT_MESSAGE)(token, moduleName));
8
+ super(messages_1.UNKNOWN_EXPORT_MESSAGE(token, moduleName));
9
9
  }
10
10
  }
11
11
  exports.UnknownExportException = UnknownExportException;
@@ -26,7 +26,7 @@ const getDependencyName = (dependency) =>
26
26
  // use class name
27
27
  getInstanceName(dependency) ||
28
28
  // use injection token (symbol)
29
- ((0, shared_utils_1.isSymbol)(dependency) && dependency.toString()) ||
29
+ (shared_utils_1.isSymbol(dependency) && dependency.toString()) ||
30
30
  // use string directly
31
31
  dependency ||
32
32
  // otherwise
@@ -51,7 +51,7 @@ Potential solutions:
51
51
  imports: [ /* the Module containing ${dependencyName} */ ]
52
52
  })
53
53
  `;
54
- if ((0, shared_utils_1.isNil)(index)) {
54
+ if (shared_utils_1.isNil(index)) {
55
55
  message += `. Please make sure that the "${key.toString()}" property is available in the current context.${potentialSolutions}`;
56
56
  return message;
57
57
  }
@@ -103,7 +103,7 @@ Scope [${stringifyScope(scope)}]`;
103
103
  };
104
104
  exports.UNDEFINED_MODULE_MESSAGE = UNDEFINED_MODULE_MESSAGE;
105
105
  const UNKNOWN_EXPORT_MESSAGE = (token = 'item', module) => {
106
- token = (0, shared_utils_1.isSymbol)(token) ? token.toString() : token;
106
+ token = shared_utils_1.isSymbol(token) ? token.toString() : token;
107
107
  return `Nest cannot export a provider/module that is not a part of the currently processed module (${module}). Please verify whether the exported ${token} is available in this particular context.
108
108
 
109
109
  Possible Solutions:
@@ -12,11 +12,11 @@ class BaseExceptionFilterContext extends context_creator_1.ContextCreator {
12
12
  this.container = container;
13
13
  }
14
14
  createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) {
15
- if ((0, shared_utils_1.isEmpty)(metadata)) {
15
+ if (shared_utils_1.isEmpty(metadata)) {
16
16
  return [];
17
17
  }
18
- return (0, iterare_1.iterate)(metadata)
19
- .filter(instance => instance && ((0, shared_utils_1.isFunction)(instance.catch) || instance.name))
18
+ return iterare_1.iterate(metadata)
19
+ .filter(instance => instance && (shared_utils_1.isFunction(instance.catch) || instance.name))
20
20
  .map(filter => this.getFilterInstance(filter, contextId, inquirerId))
21
21
  .filter(item => !!item)
22
22
  .map(instance => ({
@@ -17,7 +17,7 @@ class BaseExceptionFilter {
17
17
  return this.handleUnknownError(exception, host, applicationRef);
18
18
  }
19
19
  const res = exception.getResponse();
20
- const message = (0, shared_utils_1.isObject)(res)
20
+ const message = shared_utils_1.isObject(res)
21
21
  ? res
22
22
  : {
23
23
  statusCode: exception.getStatus(),
@@ -42,7 +42,7 @@ class BaseExceptionFilter {
42
42
  return BaseExceptionFilter.logger.error(exception);
43
43
  }
44
44
  isExceptionObject(err) {
45
- return (0, shared_utils_1.isObject)(err) && !!err.message;
45
+ return shared_utils_1.isObject(err) && !!err.message;
46
46
  }
47
47
  /**
48
48
  * Checks if the thrown error comes from the "http-errors" library.
@@ -53,9 +53,9 @@ class BaseExceptionFilter {
53
53
  }
54
54
  }
55
55
  BaseExceptionFilter.logger = new common_1.Logger('ExceptionsHandler');
56
- (0, tslib_1.__decorate)([
57
- (0, common_1.Optional)(),
58
- (0, common_1.Inject)(),
59
- (0, tslib_1.__metadata)("design:type", http_adapter_host_1.HttpAdapterHost)
56
+ tslib_1.__decorate([
57
+ common_1.Optional(),
58
+ common_1.Inject(),
59
+ tslib_1.__metadata("design:type", http_adapter_host_1.HttpAdapterHost)
60
60
  ], BaseExceptionFilter.prototype, "httpAdapterHost", void 0);
61
61
  exports.BaseExceptionFilter = BaseExceptionFilter;
@@ -22,7 +22,7 @@ class ExceptionsHandler extends base_exception_filter_1.BaseExceptionFilter {
22
22
  this.filters = filters;
23
23
  }
24
24
  invokeCustomFilters(exception, ctx) {
25
- if ((0, shared_utils_1.isEmpty)(this.filters)) {
25
+ if (shared_utils_1.isEmpty(this.filters)) {
26
26
  return false;
27
27
  }
28
28
  const isInstanceOf = (metatype) => exception instanceof metatype;
@@ -16,7 +16,7 @@ class ExternalExceptionFilterContext extends base_exception_filter_context_1.Bas
16
16
  this.moduleContext = module;
17
17
  const exceptionHandler = new external_exceptions_handler_1.ExternalExceptionsHandler();
18
18
  const filters = this.createContext(instance, callback, constants_1.EXCEPTION_FILTERS_METADATA, contextId, inquirerId);
19
- if ((0, shared_utils_1.isEmpty)(filters)) {
19
+ if (shared_utils_1.isEmpty(filters)) {
20
20
  return exceptionHandler;
21
21
  }
22
22
  exceptionHandler.setCustomFilters(filters.reverse());
@@ -31,7 +31,7 @@ class ExternalExceptionFilterContext extends base_exception_filter_context_1.Bas
31
31
  return globalFilters;
32
32
  }
33
33
  const scopedFilterWrappers = this.config.getGlobalRequestFilters();
34
- const scopedFilters = (0, iterare_1.iterate)(scopedFilterWrappers)
34
+ const scopedFilters = iterare_1.iterate(scopedFilterWrappers)
35
35
  .map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
36
36
  .filter(host => !!host)
37
37
  .map(host => host.instance)
@@ -23,7 +23,7 @@ class ExternalExceptionsHandler extends external_exception_filter_1.ExternalExce
23
23
  this.filters = filters;
24
24
  }
25
25
  invokeCustomFilters(exception, host) {
26
- if ((0, shared_utils_1.isEmpty)(this.filters)) {
26
+ if (shared_utils_1.isEmpty(this.filters)) {
27
27
  return null;
28
28
  }
29
29
  const isInstanceOf = (metatype) => exception instanceof metatype;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./base-exception-filter"), exports);
4
+ tslib_1.__exportStar(require("./base-exception-filter"), exports);
@@ -6,7 +6,7 @@ const rxjs_1 = require("rxjs");
6
6
  const execution_context_host_1 = require("../helpers/execution-context-host");
7
7
  class GuardsConsumer {
8
8
  async tryActivate(guards, args, instance, callback, type) {
9
- if (!guards || (0, shared_utils_1.isEmpty)(guards)) {
9
+ if (!guards || shared_utils_1.isEmpty(guards)) {
10
10
  return true;
11
11
  }
12
12
  const context = this.createContext(args, instance, callback);
@@ -25,7 +25,7 @@ class GuardsConsumer {
25
25
  }
26
26
  async pickResult(result) {
27
27
  if (result instanceof rxjs_1.Observable) {
28
- return (0, rxjs_1.lastValueFrom)(result);
28
+ return rxjs_1.lastValueFrom(result);
29
29
  }
30
30
  return result;
31
31
  }
@@ -17,13 +17,13 @@ class GuardsContextCreator extends context_creator_1.ContextCreator {
17
17
  return this.createContext(instance, callback, constants_1.GUARDS_METADATA, contextId, inquirerId);
18
18
  }
19
19
  createConcreteContext(metadata, contextId = constants_2.STATIC_CONTEXT, inquirerId) {
20
- if ((0, shared_utils_1.isEmpty)(metadata)) {
20
+ if (shared_utils_1.isEmpty(metadata)) {
21
21
  return [];
22
22
  }
23
- return (0, iterare_1.iterate)(metadata)
23
+ return iterare_1.iterate(metadata)
24
24
  .filter((guard) => guard && (guard.name || guard.canActivate))
25
25
  .map(guard => this.getGuardInstance(guard, contextId, inquirerId))
26
- .filter((guard) => guard && (0, shared_utils_1.isFunction)(guard.canActivate))
26
+ .filter((guard) => guard && shared_utils_1.isFunction(guard.canActivate))
27
27
  .toArray();
28
28
  }
29
29
  getGuardInstance(metatype, contextId = constants_2.STATIC_CONTEXT, inquirerId) {
@@ -59,7 +59,7 @@ class GuardsContextCreator extends context_creator_1.ContextCreator {
59
59
  return globalGuards;
60
60
  }
61
61
  const scopedGuardWrappers = this.config.getGlobalRequestGuards();
62
- const scopedGuards = (0, iterare_1.iterate)(scopedGuardWrappers)
62
+ const scopedGuards = iterare_1.iterate(scopedGuardWrappers)
63
63
  .map(wrapper => wrapper.getInstanceByContextId(contextId, inquirerId))
64
64
  .filter(host => !!host)
65
65
  .map(host => host.instance)
@@ -36,7 +36,7 @@ class ContextUtils {
36
36
  return paramsProperties.map(param => (Object.assign(Object.assign({}, param), { metatype: paramtypes[param.index] })));
37
37
  }
38
38
  getCustomFactory(factory, data, contextFactory) {
39
- return (0, shared_utils_1.isFunction)(factory)
39
+ return shared_utils_1.isFunction(factory)
40
40
  ? (...args) => factory(data, contextFactory(args))
41
41
  : () => null;
42
42
  }
@@ -143,13 +143,13 @@ class ExternalContextCreator {
143
143
  return paramsOptions.length ? pipesFn : null;
144
144
  }
145
145
  async getParamValue(value, { metatype, type, data }, pipes) {
146
- return (0, shared_utils_1.isEmpty)(pipes)
146
+ return shared_utils_1.isEmpty(pipes)
147
147
  ? value
148
148
  : this.pipesConsumer.apply(value, { metatype, type, data }, pipes);
149
149
  }
150
150
  async transformToResult(resultOrDeferred) {
151
- if ((0, rxjs_1.isObservable)(resultOrDeferred)) {
152
- return (0, rxjs_1.lastValueFrom)(resultOrDeferred);
151
+ if (rxjs_1.isObservable(resultOrDeferred)) {
152
+ return rxjs_1.lastValueFrom(resultOrDeferred);
153
153
  }
154
154
  return resultOrDeferred;
155
155
  }
package/helpers/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./context-id-factory"), exports);
5
- (0, tslib_1.__exportStar)(require("./http-adapter-host"), exports);
4
+ tslib_1.__exportStar(require("./context-id-factory"), exports);
5
+ tslib_1.__exportStar(require("./http-adapter-host"), exports);
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./external-handler-metadata.interface"), exports);
5
- (0, tslib_1.__exportStar)(require("./params-metadata.interface"), exports);
4
+ tslib_1.__exportStar(require("./external-handler-metadata.interface"), exports);
5
+ tslib_1.__exportStar(require("./params-metadata.interface"), exports);
@@ -10,14 +10,14 @@ const transient_instances_1 = require("../injector/helpers/transient-instances")
10
10
  * @param instance The instance which should be checked
11
11
  */
12
12
  function hasBeforeApplicationShutdownHook(instance) {
13
- return (0, shared_utils_1.isFunction)(instance.beforeApplicationShutdown);
13
+ return shared_utils_1.isFunction(instance.beforeApplicationShutdown);
14
14
  }
15
15
  /**
16
16
  * Calls the given instances
17
17
  */
18
18
  function callOperator(instances, signal) {
19
- return (0, iterare_1.iterate)(instances)
20
- .filter(instance => !(0, shared_utils_1.isNil)(instance))
19
+ return iterare_1.iterate(instances)
20
+ .filter(instance => !shared_utils_1.isNil(instance))
21
21
  .filter(hasBeforeApplicationShutdownHook)
22
22
  .map(async (instance) => instance.beforeApplicationShutdown(signal))
23
23
  .toArray();
@@ -38,9 +38,9 @@ async function callBeforeAppShutdownHook(module, signal) {
38
38
  ...module.injectables,
39
39
  ...module.middlewares,
40
40
  ];
41
- const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
41
+ const nonTransientInstances = transient_instances_1.getNonTransientInstances(instances);
42
42
  await Promise.all(callOperator(nonTransientInstances, signal));
43
- const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
43
+ const transientInstances = transient_instances_1.getTransientInstances(instances);
44
44
  await Promise.all(callOperator(transientInstances, signal));
45
45
  const moduleClassInstance = moduleClassHost.instance;
46
46
  if (moduleClassInstance &&
package/hooks/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./on-app-bootstrap.hook"), exports);
5
- (0, tslib_1.__exportStar)(require("./on-app-shutdown.hook"), exports);
6
- (0, tslib_1.__exportStar)(require("./on-module-destroy.hook"), exports);
7
- (0, tslib_1.__exportStar)(require("./on-module-init.hook"), exports);
8
- (0, tslib_1.__exportStar)(require("./before-app-shutdown.hook"), exports);
4
+ tslib_1.__exportStar(require("./on-app-bootstrap.hook"), exports);
5
+ tslib_1.__exportStar(require("./on-app-shutdown.hook"), exports);
6
+ tslib_1.__exportStar(require("./on-module-destroy.hook"), exports);
7
+ tslib_1.__exportStar(require("./on-module-init.hook"), exports);
8
+ tslib_1.__exportStar(require("./before-app-shutdown.hook"), exports);
@@ -10,14 +10,14 @@ const transient_instances_1 = require("../injector/helpers/transient-instances")
10
10
  * @param instance The instance which should be checked
11
11
  */
12
12
  function hasOnAppBootstrapHook(instance) {
13
- return (0, shared_utils_1.isFunction)(instance.onApplicationBootstrap);
13
+ return shared_utils_1.isFunction(instance.onApplicationBootstrap);
14
14
  }
15
15
  /**
16
16
  * Calls the given instances
17
17
  */
18
18
  function callOperator(instances) {
19
- return (0, iterare_1.iterate)(instances)
20
- .filter(instance => !(0, shared_utils_1.isNil)(instance))
19
+ return iterare_1.iterate(instances)
20
+ .filter(instance => !shared_utils_1.isNil(instance))
21
21
  .filter(hasOnAppBootstrapHook)
22
22
  .map(async (instance) => instance.onApplicationBootstrap())
23
23
  .toArray();
@@ -39,9 +39,9 @@ async function callModuleBootstrapHook(module) {
39
39
  ...module.injectables,
40
40
  ...module.middlewares,
41
41
  ];
42
- const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
42
+ const nonTransientInstances = transient_instances_1.getNonTransientInstances(instances);
43
43
  await Promise.all(callOperator(nonTransientInstances));
44
- const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
44
+ const transientInstances = transient_instances_1.getTransientInstances(instances);
45
45
  await Promise.all(callOperator(transientInstances));
46
46
  // Call the instance itself
47
47
  const moduleClassInstance = moduleClassHost.instance;
@@ -10,14 +10,14 @@ const transient_instances_1 = require("../injector/helpers/transient-instances")
10
10
  * @param instance The instance which should be checked
11
11
  */
12
12
  function hasOnAppShutdownHook(instance) {
13
- return (0, shared_utils_1.isFunction)(instance.onApplicationShutdown);
13
+ return shared_utils_1.isFunction(instance.onApplicationShutdown);
14
14
  }
15
15
  /**
16
16
  * Calls the given instances
17
17
  */
18
18
  function callOperator(instances, signal) {
19
- return (0, iterare_1.iterate)(instances)
20
- .filter(instance => !(0, shared_utils_1.isNil)(instance))
19
+ return iterare_1.iterate(instances)
20
+ .filter(instance => !shared_utils_1.isNil(instance))
21
21
  .filter(hasOnAppShutdownHook)
22
22
  .map(async (instance) => instance.onApplicationShutdown(signal))
23
23
  .toArray();
@@ -39,9 +39,9 @@ async function callAppShutdownHook(module, signal) {
39
39
  ...module.injectables,
40
40
  ...module.middlewares,
41
41
  ];
42
- const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
42
+ const nonTransientInstances = transient_instances_1.getNonTransientInstances(instances);
43
43
  await Promise.all(callOperator(nonTransientInstances, signal));
44
- const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
44
+ const transientInstances = transient_instances_1.getTransientInstances(instances);
45
45
  await Promise.all(callOperator(transientInstances, signal));
46
46
  // Call the instance itself
47
47
  const moduleClassInstance = moduleClassHost.instance;
@@ -10,14 +10,14 @@ const transient_instances_1 = require("../injector/helpers/transient-instances")
10
10
  * @param instance The instance which should be checked
11
11
  */
12
12
  function hasOnModuleDestroyHook(instance) {
13
- return (0, shared_utils_1.isFunction)(instance.onModuleDestroy);
13
+ return shared_utils_1.isFunction(instance.onModuleDestroy);
14
14
  }
15
15
  /**
16
16
  * Calls the given instances onModuleDestroy hook
17
17
  */
18
18
  function callOperator(instances) {
19
- return (0, iterare_1.iterate)(instances)
20
- .filter(instance => !(0, shared_utils_1.isNil)(instance))
19
+ return iterare_1.iterate(instances)
20
+ .filter(instance => !shared_utils_1.isNil(instance))
21
21
  .filter(hasOnModuleDestroyHook)
22
22
  .map(async (instance) => instance.onModuleDestroy())
23
23
  .toArray();
@@ -39,9 +39,9 @@ async function callModuleDestroyHook(module) {
39
39
  ...module.injectables,
40
40
  ...module.middlewares,
41
41
  ];
42
- const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
42
+ const nonTransientInstances = transient_instances_1.getNonTransientInstances(instances);
43
43
  await Promise.all(callOperator(nonTransientInstances));
44
- const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
44
+ const transientInstances = transient_instances_1.getTransientInstances(instances);
45
45
  await Promise.all(callOperator(transientInstances));
46
46
  // Call the module instance itself
47
47
  const moduleClassInstance = moduleClassHost.instance;
@@ -10,14 +10,14 @@ const transient_instances_1 = require("../injector/helpers/transient-instances")
10
10
  * @param instance The instance which should be checked
11
11
  */
12
12
  function hasOnModuleInitHook(instance) {
13
- return (0, shared_utils_1.isFunction)(instance.onModuleInit);
13
+ return shared_utils_1.isFunction(instance.onModuleInit);
14
14
  }
15
15
  /**
16
16
  * Calls the given instances
17
17
  */
18
18
  function callOperator(instances) {
19
- return (0, iterare_1.iterate)(instances)
20
- .filter(instance => !(0, shared_utils_1.isNil)(instance))
19
+ return iterare_1.iterate(instances)
20
+ .filter(instance => !shared_utils_1.isNil(instance))
21
21
  .filter(hasOnModuleInitHook)
22
22
  .map(async (instance) => instance.onModuleInit())
23
23
  .toArray();
@@ -39,9 +39,9 @@ async function callModuleInitHook(module) {
39
39
  ...module.injectables,
40
40
  ...module.middlewares,
41
41
  ];
42
- const nonTransientInstances = (0, transient_instances_1.getNonTransientInstances)(instances);
42
+ const nonTransientInstances = transient_instances_1.getNonTransientInstances(instances);
43
43
  await Promise.all(callOperator(nonTransientInstances));
44
- const transientInstances = (0, transient_instances_1.getTransientInstances)(instances);
44
+ const transientInstances = transient_instances_1.getTransientInstances(instances);
45
45
  await Promise.all(callOperator(transientInstances));
46
46
  // Call the instance itself
47
47
  const moduleClassInstance = moduleClassHost.instance;
package/index.js CHANGED
@@ -9,22 +9,22 @@ const tslib_1 = require("tslib");
9
9
  * MIT Licensed
10
10
  */
11
11
  require("reflect-metadata");
12
- (0, tslib_1.__exportStar)(require("./adapters"), exports);
13
- (0, tslib_1.__exportStar)(require("./application-config"), exports);
12
+ tslib_1.__exportStar(require("./adapters"), exports);
13
+ tslib_1.__exportStar(require("./application-config"), exports);
14
14
  var constants_1 = require("./constants");
15
15
  Object.defineProperty(exports, "APP_FILTER", { enumerable: true, get: function () { return constants_1.APP_FILTER; } });
16
16
  Object.defineProperty(exports, "APP_GUARD", { enumerable: true, get: function () { return constants_1.APP_GUARD; } });
17
17
  Object.defineProperty(exports, "APP_INTERCEPTOR", { enumerable: true, get: function () { return constants_1.APP_INTERCEPTOR; } });
18
18
  Object.defineProperty(exports, "APP_PIPE", { enumerable: true, get: function () { return constants_1.APP_PIPE; } });
19
- (0, tslib_1.__exportStar)(require("./discovery"), exports);
20
- (0, tslib_1.__exportStar)(require("./exceptions"), exports);
21
- (0, tslib_1.__exportStar)(require("./helpers"), exports);
22
- (0, tslib_1.__exportStar)(require("./injector"), exports);
23
- (0, tslib_1.__exportStar)(require("./metadata-scanner"), exports);
24
- (0, tslib_1.__exportStar)(require("./middleware"), exports);
25
- (0, tslib_1.__exportStar)(require("./nest-application"), exports);
26
- (0, tslib_1.__exportStar)(require("./nest-application-context"), exports);
19
+ tslib_1.__exportStar(require("./discovery"), exports);
20
+ tslib_1.__exportStar(require("./exceptions"), exports);
21
+ tslib_1.__exportStar(require("./helpers"), exports);
22
+ tslib_1.__exportStar(require("./injector"), exports);
23
+ tslib_1.__exportStar(require("./metadata-scanner"), exports);
24
+ tslib_1.__exportStar(require("./middleware"), exports);
25
+ tslib_1.__exportStar(require("./nest-application"), exports);
26
+ tslib_1.__exportStar(require("./nest-application-context"), exports);
27
27
  var nest_factory_1 = require("./nest-factory");
28
28
  Object.defineProperty(exports, "NestFactory", { enumerable: true, get: function () { return nest_factory_1.NestFactory; } });
29
- (0, tslib_1.__exportStar)(require("./router"), exports);
30
- (0, tslib_1.__exportStar)(require("./services"), exports);
29
+ tslib_1.__exportStar(require("./router"), exports);
30
+ tslib_1.__exportStar(require("./services"), exports);
@@ -16,7 +16,7 @@ class ModuleCompiler {
16
16
  if (!this.isDynamicModule(metatype)) {
17
17
  return { type: metatype };
18
18
  }
19
- const { module: type } = metatype, dynamicMetadata = (0, tslib_1.__rest)(metatype, ["module"]);
19
+ const { module: type } = metatype, dynamicMetadata = tslib_1.__rest(metatype, ["module"]);
20
20
  return { type, dynamicMetadata };
21
21
  }
22
22
  isDynamicModule(module) {
@@ -7,7 +7,7 @@ const iterare_1 = require("iterare");
7
7
  * @param instances The instances which should be checked whether they are transcient
8
8
  */
9
9
  function getTransientInstances(instances) {
10
- return (0, iterare_1.iterate)(instances)
10
+ return iterare_1.iterate(instances)
11
11
  .filter(([_, wrapper]) => wrapper.isDependencyTreeStatic())
12
12
  .map(([_, wrapper]) => wrapper.getStaticTransientInstances())
13
13
  .flatten()
@@ -21,7 +21,7 @@ exports.getTransientInstances = getTransientInstances;
21
21
  * @param instances The instances which should be checked whether they are transcient
22
22
  */
23
23
  function getNonTransientInstances(instances) {
24
- return (0, iterare_1.iterate)(instances)
24
+ return iterare_1.iterate(instances)
25
25
  .filter(([key, wrapper]) => wrapper.isDependencyTreeStatic() && !wrapper.isTransient)
26
26
  .map(([key, { instance }]) => instance)
27
27
  .toArray();