@venok/core 1.1.0 → 2.0.1-next.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.
- package/dist/application/config.js +92 -0
- package/dist/application/context.js +252 -0
- package/dist/application/factory.js +136 -0
- package/dist/constants.js +100 -0
- package/dist/context/context-id.factory.js +58 -0
- package/dist/context/context.js +186 -0
- package/dist/context/creator.js +49 -0
- package/dist/context/execution-host.js +51 -0
- package/dist/context/proxy.js +43 -0
- package/dist/decorators/apply.decorator.js +33 -0
- package/dist/decorators/bind.decorator.js +28 -0
- package/dist/decorators/catch.decorator.js +29 -0
- package/dist/decorators/dependencies.decorator.js +30 -0
- package/dist/decorators/exception-filters.decorator.js +40 -0
- package/dist/decorators/global.decorator.js +28 -0
- package/dist/decorators/inject.decorator.js +42 -0
- package/dist/decorators/injectable.decorator.js +38 -0
- package/dist/decorators/module.decorator.js +42 -0
- package/dist/decorators/optional.decorator.js +35 -0
- package/dist/decorators/set-metadata.decorator.js +35 -0
- package/dist/decorators/use-guards.decorator.js +39 -0
- package/dist/decorators/use-interceptors.decorator.js +39 -0
- package/dist/decorators/use-pipes.decorator.js +38 -0
- package/dist/enums/scope.enum.js +28 -0
- package/dist/enums/shutdown-signal.enum.js +36 -0
- package/dist/errors/exceptions/circular-dependency.exception.js +30 -0
- package/dist/errors/exceptions/invalid-class-module.exception.js +30 -0
- package/dist/errors/exceptions/invalid-class-scope.exception.js +33 -0
- package/dist/errors/exceptions/invalid-class.exception.js +30 -0
- package/dist/errors/exceptions/invalid-exception-filter.exception.js +30 -0
- package/dist/errors/exceptions/invalid-module.exception.js +30 -0
- package/dist/errors/exceptions/runtime.exception.js +30 -0
- package/dist/errors/exceptions/undefined-dependency.exception.js +30 -0
- package/dist/errors/exceptions/undefined-forwardref.exception.js +30 -0
- package/dist/errors/exceptions/undefined-module.exception.js +30 -0
- package/dist/errors/exceptions/unknown-dependencies.exception.js +38 -0
- package/dist/errors/exceptions/unknown-element.exception.js +31 -0
- package/dist/errors/exceptions/unknown-export.exception.js +30 -0
- package/dist/errors/exceptions/unknown-module.exception.js +29 -0
- package/dist/errors/messages.js +134 -0
- package/dist/exceptions/handler.js +53 -0
- package/dist/exceptions/zone/handler.js +30 -0
- package/dist/exceptions/zone/zone.js +49 -0
- package/dist/filters/context-creator.js +65 -0
- package/dist/filters/context.js +58 -0
- package/dist/filters/filter.js +36 -0
- package/dist/guards/consumer.js +54 -0
- package/dist/guards/context-creator.js +76 -0
- package/dist/helpers/color.helper.js +35 -0
- package/dist/helpers/context-id-factory.helper.js +25 -0
- package/dist/helpers/context.helper.js +65 -0
- package/dist/helpers/create-param-decorator.helper.js +73 -0
- package/dist/helpers/filter-log-levels.util.js +38 -0
- package/dist/helpers/flatten.helper.js +26 -0
- package/dist/helpers/is-log-level-enabled.util.js +39 -0
- package/dist/helpers/is-log-level.util.js +26 -0
- package/dist/helpers/messages.helper.js +23 -0
- package/dist/helpers/metadata.helper.js +51 -0
- package/dist/helpers/noop.helper.js +23 -0
- package/dist/helpers/random-string-generator.helper.js +24 -0
- package/dist/helpers/rethrow.helper.js +25 -0
- package/dist/helpers/shared.helper.js +49 -0
- package/dist/helpers/silent.helper.js +34 -0
- package/dist/helpers/transient.helper.js +30 -0
- package/dist/helpers/uuid.helper.js +60 -0
- package/dist/helpers/validate-each.helper.js +42 -0
- package/dist/hooks/before-app-shutdown.hook.js +43 -0
- package/dist/hooks/on-app-bootstrap.hook.js +43 -0
- package/dist/hooks/on-app-shutdown.hook.js +43 -0
- package/dist/hooks/on-module-destroy.hook.js +43 -0
- package/dist/hooks/on-module-init.hook.js +43 -0
- package/dist/index.d.ts +3141 -0
- package/dist/index.js +117 -0
- package/dist/injector/constants.js +28 -0
- package/dist/injector/container.js +229 -0
- package/dist/injector/helpers/barrier.js +48 -0
- package/dist/injector/helpers/class-scope.helper.js +27 -0
- package/dist/injector/helpers/classifier.helper.js +35 -0
- package/dist/injector/helpers/is-durable.helper.js +27 -0
- package/dist/injector/injector.js +490 -0
- package/dist/injector/instance/links-host.js +68 -0
- package/dist/injector/instance/loader.js +95 -0
- package/dist/injector/instance/resolver.js +61 -0
- package/dist/injector/instance/wrapper.js +324 -0
- package/dist/injector/internal-core-module/core-providers.js +42 -0
- package/dist/injector/internal-core-module/internal-core-module-factory.js +66 -0
- package/dist/injector/internal-core-module/internal-core-module.js +46 -0
- package/dist/injector/module/compiler.js +47 -0
- package/dist/injector/module/container.js +33 -0
- package/dist/injector/module/lazy/loader.js +71 -0
- package/dist/injector/module/module.js +395 -0
- package/dist/injector/module/ref.js +78 -0
- package/dist/injector/module/token-factory.js +82 -0
- package/dist/injector/settlement-signal.js +50 -0
- package/dist/injector/topology-tree/topology-tree.js +68 -0
- package/dist/injector/topology-tree/tree-node.js +68 -0
- package/dist/inspector/graph-inspector.js +182 -0
- package/dist/inspector/initialize-on-preview.allowlist.js +31 -0
- package/dist/inspector/noop-graph-inspector.js +27 -0
- package/dist/inspector/partial-graph.host.js +34 -0
- package/dist/inspector/serialized-graph.js +128 -0
- package/dist/interceptors/consumer.js +54 -0
- package/dist/interceptors/context-creator.js +75 -0
- package/dist/interfaces/application/context-options.interface.js +31 -0
- package/dist/interfaces/application/context.interface.js +0 -0
- package/dist/interfaces/application/index.js +3 -0
- package/dist/interfaces/context/arguments-host.interface.js +0 -0
- package/dist/interfaces/context/context-id-factory.interface.js +0 -0
- package/dist/interfaces/context/context.interface.js +0 -0
- package/dist/interfaces/context/creator.interface.js +0 -0
- package/dist/interfaces/context/execution.interface.js +0 -0
- package/dist/interfaces/context/index.js +7 -0
- package/dist/interfaces/context/params.interface.js +0 -0
- package/dist/interfaces/features/exception-filter.interface.js +0 -0
- package/dist/interfaces/features/guards.interface.js +0 -0
- package/dist/interfaces/features/index.js +5 -0
- package/dist/interfaces/features/interceptor.interface.js +0 -0
- package/dist/interfaces/features/pipes.interface.js +0 -0
- package/dist/interfaces/helper.interface.js +0 -0
- package/dist/interfaces/hooks/before-application-shutdown.interface.js +0 -0
- package/dist/interfaces/hooks/index.js +6 -0
- package/dist/interfaces/hooks/on-application-bootstrap.interface.js +0 -0
- package/dist/interfaces/hooks/on-application-shutdown.interface.js +0 -0
- package/dist/interfaces/hooks/on-destroy.interface.js +0 -0
- package/dist/interfaces/hooks/on-init.interface.js +0 -0
- package/dist/interfaces/index.js +16 -0
- package/dist/interfaces/injectable.interface.js +0 -0
- package/dist/interfaces/injector/index.js +6 -0
- package/dist/interfaces/injector/injector.interface.js +0 -0
- package/dist/interfaces/injector/instance-wrapper.interface.js +0 -0
- package/dist/interfaces/injector/lazy-module-options.interface.js +0 -0
- package/dist/interfaces/injector/module-compiler.interface.js +0 -0
- package/dist/interfaces/injector/module-ref.interface.js +0 -0
- package/dist/interfaces/inspector/edge.interface.js +0 -0
- package/dist/interfaces/inspector/enhancer-metadata-cache-entry.interface.js +0 -0
- package/dist/interfaces/inspector/entrypoint.interface.js +0 -0
- package/dist/interfaces/inspector/extras.interface.js +0 -0
- package/dist/interfaces/inspector/index.js +8 -0
- package/dist/interfaces/inspector/node.interface.js +0 -0
- package/dist/interfaces/inspector/serialized-graph-json.interface.js +0 -0
- package/dist/interfaces/inspector/serialized-graph-metadata.interface.js +0 -0
- package/dist/interfaces/modules/definition.interface.js +0 -0
- package/dist/interfaces/modules/dynamic-module.interface.js +0 -0
- package/dist/interfaces/modules/forward-reference.interface.js +0 -0
- package/dist/interfaces/modules/index.js +10 -0
- package/dist/interfaces/modules/injection-token.interface.js +0 -0
- package/dist/interfaces/modules/introspection-result.interface.js +0 -0
- package/dist/interfaces/modules/module-metadata.interface.js +0 -0
- package/dist/interfaces/modules/module.interface.js +0 -0
- package/dist/interfaces/modules/optional-factory-dependency.interface.js +0 -0
- package/dist/interfaces/modules/override.interface.js +0 -0
- package/dist/interfaces/modules/provider.interface.js +0 -0
- package/dist/interfaces/param-decorator.interface.js +0 -0
- package/dist/interfaces/scope.interface.js +0 -0
- package/dist/interfaces/services/console.interface.js +0 -0
- package/dist/interfaces/services/index.js +4 -0
- package/dist/interfaces/services/logger.interface.js +0 -0
- package/dist/interfaces/services/reflector.interface.js +0 -0
- package/dist/interfaces/set-metadata.interface.js +0 -0
- package/dist/interfaces/type.interface.js +0 -0
- package/dist/metadata-scanner.js +50 -0
- package/dist/pipes/consumer.js +33 -0
- package/dist/pipes/context-creator.js +78 -0
- package/dist/scanner.js +371 -0
- package/dist/services/console.service.js +347 -0
- package/dist/services/logger.service.js +276 -0
- package/dist/services/reflector.service.js +82 -0
- package/dist/storage/handler-metadata.storage.js +42 -0
- package/dist/storage/meta-host.storage.js +62 -0
- package/package.json +52 -40
- package/application/config.d.ts +0 -35
- package/application/config.js +0 -85
- package/application/context.d.ts +0 -198
- package/application/context.js +0 -325
- package/application/factory.d.ts +0 -43
- package/application/factory.js +0 -147
- package/constants.d.ts +0 -44
- package/constants.js +0 -51
- package/context/context.d.ts +0 -66
- package/context/context.js +0 -156
- package/context/creator.d.ts +0 -9
- package/context/creator.js +0 -32
- package/context/execution-host.d.ts +0 -16
- package/context/execution-host.js +0 -30
- package/context/index.d.ts +0 -4
- package/context/index.js +0 -20
- package/context/proxy.d.ts +0 -6
- package/context/proxy.js +0 -33
- package/decorators/apply.decorator.d.ts +0 -10
- package/decorators/apply.decorator.js +0 -24
- package/decorators/bind.decorator.d.ts +0 -11
- package/decorators/bind.decorator.js +0 -20
- package/decorators/catch.decorator.d.ts +0 -17
- package/decorators/catch.decorator.js +0 -26
- package/decorators/create-param.decorator.d.ts +0 -29
- package/decorators/create-param.decorator.js +0 -51
- package/decorators/dependencies.decorator.d.ts +0 -6
- package/decorators/dependencies.decorator.js +0 -17
- package/decorators/exception-filters.decorator.d.ts +0 -21
- package/decorators/exception-filters.decorator.js +0 -41
- package/decorators/global.decorator.d.ts +0 -10
- package/decorators/global.decorator.js +0 -19
- package/decorators/index.d.ts +0 -15
- package/decorators/index.js +0 -31
- package/decorators/inject.decorator.d.ts +0 -26
- package/decorators/inject.decorator.js +0 -45
- package/decorators/injectable.decorator.d.ts +0 -40
- package/decorators/injectable.decorator.js +0 -51
- package/decorators/module.decorator.d.ts +0 -14
- package/decorators/module.decorator.js +0 -38
- package/decorators/optional.decorator.d.ts +0 -14
- package/decorators/optional.decorator.js +0 -30
- package/decorators/set-metadata.decorator.d.ts +0 -18
- package/decorators/set-metadata.decorator.js +0 -30
- package/decorators/use-guards.decorator.d.ts +0 -21
- package/decorators/use-guards.decorator.js +0 -40
- package/decorators/use-interceptors.decorator.d.ts +0 -21
- package/decorators/use-interceptors.decorator.js +0 -40
- package/decorators/use-pipes.decorator.d.ts +0 -21
- package/decorators/use-pipes.decorator.js +0 -39
- package/discovery/meta-host-collection.d.ts +0 -32
- package/discovery/meta-host-collection.js +0 -79
- package/discovery/module.d.ts +0 -5
- package/discovery/module.js +0 -24
- package/discovery/service.d.ts +0 -68
- package/discovery/service.js +0 -90
- package/errors/exceptions/circular-dependency.exception.d.ts +0 -4
- package/errors/exceptions/circular-dependency.exception.js +0 -11
- package/errors/exceptions/index.d.ts +0 -8
- package/errors/exceptions/index.js +0 -24
- package/errors/exceptions/invalid-class-module.exception.d.ts +0 -4
- package/errors/exceptions/invalid-class-module.exception.js +0 -11
- package/errors/exceptions/invalid-class-scope.exception.d.ts +0 -5
- package/errors/exceptions/invalid-class-scope.exception.js +0 -14
- package/errors/exceptions/invalid-class.exception.d.ts +0 -4
- package/errors/exceptions/invalid-class.exception.js +0 -11
- package/errors/exceptions/invalid-exception-filter.exception.d.ts +0 -4
- package/errors/exceptions/invalid-exception-filter.exception.js +0 -11
- package/errors/exceptions/invalid-module.exception.d.ts +0 -4
- package/errors/exceptions/invalid-module.exception.js +0 -11
- package/errors/exceptions/runtime.exception.d.ts +0 -4
- package/errors/exceptions/runtime.exception.js +0 -12
- package/errors/exceptions/undefined-dependency.exception.d.ts +0 -6
- package/errors/exceptions/undefined-dependency.exception.js +0 -11
- package/errors/exceptions/undefined-forwardref.exception.d.ts +0 -5
- package/errors/exceptions/undefined-forwardref.exception.js +0 -11
- package/errors/exceptions/undefined-module.exception.d.ts +0 -4
- package/errors/exceptions/undefined-module.exception.js +0 -11
- package/errors/exceptions/unknown-dependencies.exception.d.ts +0 -16
- package/errors/exceptions/unknown-dependencies.exception.js +0 -15
- package/errors/exceptions/unknown-element.exception.d.ts +0 -4
- package/errors/exceptions/unknown-element.exception.js +0 -12
- package/errors/exceptions/unknown-export.exception.d.ts +0 -4
- package/errors/exceptions/unknown-export.exception.js +0 -11
- package/errors/exceptions/unknown-module.exception.d.ts +0 -4
- package/errors/exceptions/unknown-module.exception.js +0 -10
- package/errors/messages.d.ts +0 -15
- package/errors/messages.js +0 -126
- package/exceptions/handler.d.ts +0 -10
- package/exceptions/handler.js +0 -34
- package/exceptions/index.d.ts +0 -2
- package/exceptions/index.js +0 -18
- package/exceptions/zone/handler.d.ts +0 -5
- package/exceptions/zone/handler.js +0 -15
- package/exceptions/zone/index.d.ts +0 -2
- package/exceptions/zone/index.js +0 -18
- package/exceptions/zone/zone.d.ts +0 -5
- package/exceptions/zone/zone.js +0 -32
- package/filters/context-creator.d.ts +0 -14
- package/filters/context-creator.js +0 -48
- package/filters/context.d.ts +0 -12
- package/filters/context.js +0 -41
- package/filters/filter.d.ts +0 -6
- package/filters/filter.js +0 -16
- package/filters/index.d.ts +0 -3
- package/filters/index.js +0 -19
- package/guards/consumer.d.ts +0 -9
- package/guards/consumer.js +0 -33
- package/guards/context-creator.d.ts +0 -17
- package/guards/context-creator.js +0 -69
- package/guards/index.d.ts +0 -2
- package/guards/index.js +0 -18
- package/helpers/color.helper.d.ts +0 -9
- package/helpers/color.helper.js +0 -14
- package/helpers/context-id-factory.helper.d.ts +0 -2
- package/helpers/context-id-factory.helper.js +0 -15
- package/helpers/context.helper.d.ts +0 -23
- package/helpers/context.helper.js +0 -49
- package/helpers/extends-metadata.helper.d.ts +0 -1
- package/helpers/extends-metadata.helper.js +0 -9
- package/helpers/flatten.helper.d.ts +0 -1
- package/helpers/flatten.helper.js +0 -9
- package/helpers/messages.helper.d.ts +0 -2
- package/helpers/messages.helper.js +0 -7
- package/helpers/noop.helper.d.ts +0 -1
- package/helpers/noop.helper.js +0 -5
- package/helpers/random-string-generator.helper.d.ts +0 -1
- package/helpers/random-string-generator.helper.js +0 -6
- package/helpers/rethrow.helper.d.ts +0 -1
- package/helpers/rethrow.helper.js +0 -7
- package/helpers/shared.helper.d.ts +0 -10
- package/helpers/shared.helper.js +0 -33
- package/helpers/silent.helper.d.ts +0 -10
- package/helpers/silent.helper.js +0 -18
- package/helpers/transient.helper.d.ts +0 -12
- package/helpers/transient.helper.js +0 -26
- package/helpers/uuid.helper.d.ts +0 -15
- package/helpers/uuid.helper.js +0 -54
- package/helpers/validate-each.helper.d.ts +0 -8
- package/helpers/validate-each.helper.js +0 -25
- package/hooks/before-app-shutdown.hook.d.ts +0 -9
- package/hooks/before-app-shutdown.hook.js +0 -45
- package/hooks/index.d.ts +0 -5
- package/hooks/index.js +0 -21
- package/hooks/on-app-bootstrap.hook.d.ts +0 -8
- package/hooks/on-app-bootstrap.hook.js +0 -45
- package/hooks/on-app-shutdown.hook.d.ts +0 -9
- package/hooks/on-app-shutdown.hook.js +0 -46
- package/hooks/on-module-destroy.hook.d.ts +0 -8
- package/hooks/on-module-destroy.hook.js +0 -45
- package/hooks/on-module-init.hook.d.ts +0 -8
- package/hooks/on-module-init.hook.js +0 -45
- package/index.d.ts +0 -10
- package/index.js +0 -32
- package/injector/constants.d.ts +0 -2
- package/injector/constants.js +0 -7
- package/injector/container.d.ts +0 -61
- package/injector/container.js +0 -194
- package/injector/helpers/class-scope.helper.d.ts +0 -2
- package/injector/helpers/class-scope.helper.js +0 -9
- package/injector/helpers/classifier.helper.d.ts +0 -4
- package/injector/helpers/classifier.helper.js +0 -17
- package/injector/helpers/is-durable.helper.d.ts +0 -2
- package/injector/helpers/is-durable.helper.js +0 -9
- package/injector/index.d.ts +0 -5
- package/injector/index.js +0 -20
- package/injector/injector.d.ts +0 -87
- package/injector/injector.js +0 -452
- package/injector/instance/links-host.d.ts +0 -22
- package/injector/instance/links-host.js +0 -50
- package/injector/instance/loader.d.ts +0 -21
- package/injector/instance/loader.js +0 -73
- package/injector/instance/resolver.d.ts +0 -16
- package/injector/instance/resolver.js +0 -43
- package/injector/instance/wrapper.d.ts +0 -90
- package/injector/instance/wrapper.js +0 -272
- package/injector/internal-core-module/core-providers.d.ts +0 -4
- package/injector/internal-core-module/core-providers.js +0 -21
- package/injector/internal-core-module/internal-core-module-factory.d.ts +0 -8
- package/injector/internal-core-module/internal-core-module-factory.js +0 -47
- package/injector/internal-core-module/internal-core-module.d.ts +0 -4
- package/injector/internal-core-module/internal-core-module.js +0 -31
- package/injector/module/compiler.d.ts +0 -19
- package/injector/module/compiler.js +0 -27
- package/injector/module/container.d.ts +0 -6
- package/injector/module/container.js +0 -24
- package/injector/module/lazy/loader.d.ts +0 -21
- package/injector/module/lazy/loader.js +0 -49
- package/injector/module/lazy/options.d.ts +0 -6
- package/injector/module/lazy/options.js +0 -2
- package/injector/module/module.d.ts +0 -74
- package/injector/module/module.js +0 -383
- package/injector/module/ref.d.ts +0 -106
- package/injector/module/ref.js +0 -62
- package/injector/module/token-factory.d.ts +0 -13
- package/injector/module/token-factory.js +0 -71
- package/injector/settlement-signal.d.ts +0 -37
- package/injector/settlement-signal.js +0 -55
- package/inspector/graph-inspector.d.ts +0 -26
- package/inspector/graph-inspector.js +0 -163
- package/inspector/initialize-on-preview.allowlist.d.ts +0 -6
- package/inspector/initialize-on-preview.allowlist.js +0 -13
- package/inspector/interfaces/edge.interface.d.ts +0 -28
- package/inspector/interfaces/edge.interface.js +0 -2
- package/inspector/interfaces/enhancer-metadata-cache-entry.interface.d.ts +0 -12
- package/inspector/interfaces/enhancer-metadata-cache-entry.interface.js +0 -2
- package/inspector/interfaces/entrypoint.interface.d.ts +0 -10
- package/inspector/interfaces/entrypoint.interface.js +0 -2
- package/inspector/interfaces/extras.interface.d.ts +0 -18
- package/inspector/interfaces/extras.interface.js +0 -2
- package/inspector/interfaces/node.interface.d.ts +0 -49
- package/inspector/interfaces/node.interface.js +0 -2
- package/inspector/interfaces/serialized-graph-json.interface.d.ts +0 -14
- package/inspector/interfaces/serialized-graph-json.interface.js +0 -2
- package/inspector/interfaces/serialized-graph-metadata.interface.d.ts +0 -10
- package/inspector/interfaces/serialized-graph-metadata.interface.js +0 -2
- package/inspector/noop-graph-inspector.d.ts +0 -2
- package/inspector/noop-graph-inspector.js +0 -8
- package/inspector/partial-graph.host.d.ts +0 -7
- package/inspector/partial-graph.host.js +0 -15
- package/inspector/serialized-graph.d.ts +0 -52
- package/inspector/serialized-graph.js +0 -121
- package/interceptors/consumer.d.ts +0 -9
- package/interceptors/consumer.js +0 -37
- package/interceptors/context-creator.d.ts +0 -17
- package/interceptors/context-creator.js +0 -67
- package/interceptors/index.d.ts +0 -2
- package/interceptors/index.js +0 -18
- package/interfaces/abstract.interface.d.ts +0 -3
- package/interfaces/abstract.interface.js +0 -2
- package/interfaces/application/context-options.interface.d.ts +0 -41
- package/interfaces/application/context-options.interface.js +0 -9
- package/interfaces/application/context.interface.d.ts +0 -162
- package/interfaces/application/context.interface.js +0 -2
- package/interfaces/application/index.d.ts +0 -1
- package/interfaces/application/index.js +0 -17
- package/interfaces/context/arguments-host.interface.d.ts +0 -22
- package/interfaces/context/arguments-host.interface.js +0 -2
- package/interfaces/context/execution.interface.d.ts +0 -18
- package/interfaces/context/execution.interface.js +0 -2
- package/interfaces/context/index.d.ts +0 -2
- package/interfaces/context/index.js +0 -18
- package/interfaces/features/exception-filter.interface.d.ts +0 -21
- package/interfaces/features/exception-filter.interface.js +0 -2
- package/interfaces/features/guards.interface.d.ts +0 -20
- package/interfaces/features/guards.interface.js +0 -2
- package/interfaces/features/index.d.ts +0 -4
- package/interfaces/features/index.js +0 -20
- package/interfaces/features/interceptor.interface.d.ts +0 -30
- package/interfaces/features/interceptor.interface.js +0 -2
- package/interfaces/features/pipes.interface.d.ts +0 -37
- package/interfaces/features/pipes.interface.js +0 -2
- package/interfaces/helper.interface.d.ts +0 -3
- package/interfaces/helper.interface.js +0 -2
- package/interfaces/hooks/before-application-shutdown.interface.d.ts +0 -3
- package/interfaces/hooks/before-application-shutdown.interface.js +0 -2
- package/interfaces/hooks/index.d.ts +0 -5
- package/interfaces/hooks/index.js +0 -21
- package/interfaces/hooks/on-application-bootstrap.interface.d.ts +0 -9
- package/interfaces/hooks/on-application-bootstrap.interface.js +0 -2
- package/interfaces/hooks/on-application-shutdown.interface.d.ts +0 -9
- package/interfaces/hooks/on-application-shutdown.interface.js +0 -2
- package/interfaces/hooks/on-destroy.interface.d.ts +0 -10
- package/interfaces/hooks/on-destroy.interface.js +0 -2
- package/interfaces/hooks/on-init.interface.d.ts +0 -8
- package/interfaces/hooks/on-init.interface.js +0 -2
- package/interfaces/index.d.ts +0 -8
- package/interfaces/index.js +0 -24
- package/interfaces/injectable.interface.d.ts +0 -1
- package/interfaces/injectable.interface.js +0 -2
- package/interfaces/modules/configurable/async-options.interface.d.ts +0 -42
- package/interfaces/modules/configurable/async-options.interface.js +0 -2
- package/interfaces/modules/configurable/cls.interface.d.ts +0 -13
- package/interfaces/modules/configurable/cls.interface.js +0 -2
- package/interfaces/modules/configurable/host.interface.d.ts +0 -62
- package/interfaces/modules/configurable/host.interface.js +0 -2
- package/interfaces/modules/configurable/index.d.ts +0 -3
- package/interfaces/modules/configurable/index.js +0 -19
- package/interfaces/modules/definition.interface.d.ts +0 -4
- package/interfaces/modules/definition.interface.js +0 -2
- package/interfaces/modules/dynamic-module.interface.d.ts +0 -23
- package/interfaces/modules/dynamic-module.interface.js +0 -2
- package/interfaces/modules/forward-reference.interface.d.ts +0 -3
- package/interfaces/modules/forward-reference.interface.js +0 -2
- package/interfaces/modules/index.d.ts +0 -9
- package/interfaces/modules/index.js +0 -25
- package/interfaces/modules/injection-token.interface.d.ts +0 -5
- package/interfaces/modules/injection-token.interface.js +0 -2
- package/interfaces/modules/introspection-result.interface.d.ts +0 -10
- package/interfaces/modules/introspection-result.interface.js +0 -2
- package/interfaces/modules/module-metadata.interface.d.ts +0 -24
- package/interfaces/modules/module-metadata.interface.js +0 -2
- package/interfaces/modules/module.interface.d.ts +0 -2
- package/interfaces/modules/module.interface.js +0 -2
- package/interfaces/modules/optional-factory-dependency.interface.d.ts +0 -8
- package/interfaces/modules/optional-factory-dependency.interface.js +0 -2
- package/interfaces/modules/override.interface.d.ts +0 -5
- package/interfaces/modules/override.interface.js +0 -2
- package/interfaces/modules/provider.interface.d.ts +0 -142
- package/interfaces/modules/provider.interface.js +0 -2
- package/interfaces/scope.interface.d.ts +0 -35
- package/interfaces/scope.interface.js +0 -23
- package/interfaces/type.interface.d.ts +0 -3
- package/interfaces/type.interface.js +0 -2
- package/metadata-scanner.d.ts +0 -4
- package/metadata-scanner.js +0 -34
- package/module/configurable-module.builder.d.ts +0 -93
- package/module/configurable-module.builder.js +0 -204
- package/module/constants.d.ts +0 -4
- package/module/constants.js +0 -7
- package/module/helpers/generate-options-injection-token.helper.d.ts +0 -1
- package/module/helpers/generate-options-injection-token.helper.js +0 -9
- package/module/helpers/get-injection-providers.helper.d.ts +0 -8
- package/module/helpers/get-injection-providers.helper.js +0 -36
- package/module/helpers/index.d.ts +0 -2
- package/module/helpers/index.js +0 -18
- package/module/index.d.ts +0 -2
- package/module/index.js +0 -18
- package/pipes/consumer.d.ts +0 -9
- package/pipes/consumer.js +0 -15
- package/pipes/context-creator.d.ts +0 -18
- package/pipes/context-creator.js +0 -70
- package/pipes/index.d.ts +0 -2
- package/pipes/index.js +0 -18
- package/scanner.d.ts +0 -81
- package/scanner.js +0 -374
- package/services/console.service.d.ts +0 -86
- package/services/console.service.js +0 -233
- package/services/index.d.ts +0 -1
- package/services/index.js +0 -17
- package/services/logger.service.d.ts +0 -157
- package/services/logger.service.js +0 -269
- package/services/reflector.service.d.ts +0 -110
- package/services/reflector.service.js +0 -87
- package/test/context/creator.spec.d.ts +0 -1
- package/test/context/creator.spec.js +0 -149
- package/test/context/execution-host.spec.d.ts +0 -1
- package/test/context/execution-host.spec.js +0 -31
- package/test/context/proxy.spec.d.ts +0 -1
- package/test/context/proxy.spec.js +0 -46
- package/test/exceptions/handler.spec.d.ts +0 -1
- package/test/exceptions/handler.spec.js +0 -90
- package/test/exceptions/messages.spec.js +0 -201
- package/test/exceptions/zona/handler.spec.d.ts +0 -1
- package/test/exceptions/zona/handler.spec.js +0 -51
- package/test/exceptions/zona/zone.spec.d.ts +0 -1
- package/test/exceptions/zona/zone.spec.js +0 -66
- package/test/filters/context-creator.spec.d.ts +0 -2
- package/test/filters/context-creator.spec.js +0 -91
- package/test/guards/consumer.spec.d.ts +0 -1
- package/test/guards/consumer.spec.js +0 -47
- package/test/guards/context-creator.spec.d.ts +0 -1
- package/test/guards/context-creator.spec.js +0 -138
- package/test/helpers/context-id-factory.spec.d.ts +0 -1
- package/test/helpers/context-id-factory.spec.js +0 -9
- package/test/helpers/shared.spec.d.ts +0 -1
- package/test/helpers/shared.spec.js +0 -122
- package/test/hooks/before-app-shutdown.hook.spec.d.ts +0 -1
- package/test/hooks/before-app-shutdown.hook.spec.js +0 -44
- package/test/hooks/on-app-bootstrap.hook.spec.d.ts +0 -1
- package/test/hooks/on-app-bootstrap.hook.spec.js +0 -43
- package/test/hooks/on-app-shutdown.hook.spec.d.ts +0 -1
- package/test/hooks/on-app-shutdown.hook.spec.js +0 -43
- package/test/hooks/on-module-destroy.hook.spec.d.ts +0 -1
- package/test/hooks/on-module-destroy.hook.spec.js +0 -43
- package/test/hooks/on-module-init.hook.spec.d.ts +0 -1
- package/test/hooks/on-module-init.hook.spec.js +0 -43
- package/test/injector/compiler.spec.d.ts +0 -1
- package/test/injector/compiler.spec.js +0 -42
- package/test/injector/container.spec.d.ts +0 -1
- package/test/injector/container.spec.js +0 -203
- package/test/injector/helpers/classifier.spec.d.ts +0 -1
- package/test/injector/helpers/classifier.spec.js +0 -102
- package/test/injector/injector.spec.d.ts +0 -1
- package/test/injector/injector.spec.js +0 -678
- package/test/injector/instance/loader.spec.d.ts +0 -1
- package/test/injector/instance/loader.spec.js +0 -108
- package/test/injector/instance/wrapper.spec.d.ts +0 -1
- package/test/injector/instance/wrapper.spec.js +0 -772
- package/test/injector/internal-core-module/internal-core-module-factory.spec.d.ts +0 -1
- package/test/injector/internal-core-module/internal-core-module-factory.spec.js +0 -27
- package/test/injector/module/lazy/loader.spec.d.ts +0 -1
- package/test/injector/module/lazy/loader.spec.js +0 -71
- package/test/injector/module/module.spec.d.ts +0 -1
- package/test/injector/module/module.spec.js +0 -410
- package/test/injector/module/token-factory.spec.d.ts +0 -1
- package/test/injector/module/token-factory.spec.js +0 -84
- package/test/interceptors/consumer.spec.d.ts +0 -1
- package/test/interceptors/consumer.spec.js +0 -136
- package/test/interceptors/context-creator.spec.d.ts +0 -1
- package/test/interceptors/context-creator.spec.js +0 -139
- package/test/metadata-scanner.spec.d.ts +0 -1
- package/test/metadata-scanner.spec.js +0 -41
- package/test/module/configurable-module.builder.spec.d.ts +0 -1
- package/test/module/configurable-module.builder.spec.js +0 -102
- package/test/module/helpers/get-injection-providers.helper.spec.d.ts +0 -1
- package/test/module/helpers/get-injection-providers.helper.spec.js +0 -49
- package/test/pipes/consumer.spec.d.ts +0 -1
- package/test/pipes/consumer.spec.js +0 -42
- package/test/pipes/context-creator.spec.d.ts +0 -1
- package/test/pipes/context-creator.spec.js +0 -108
- package/test/scanner.spec.d.ts +0 -1
- package/test/scanner.spec.js +0 -620
- package/test/services/logger.service.spec.d.ts +0 -1
- package/test/services/logger.service.spec.js +0 -487
- package/test/services/reflector.service.spec.d.ts +0 -1
- package/test/services/reflector.service.spec.js +0 -105
- package/tsconfig.tsbuildinfo +0 -1
- /package/{test/exceptions/messages.spec.d.ts → dist/interfaces/abstract.interface.js} +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
5
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else
|
|
7
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
8
|
+
if (d = decorators[i])
|
|
9
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
13
|
+
var __legacyMetadataTS = (k, v) => {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
15
|
+
return Reflect.metadata(k, v);
|
|
16
|
+
};
|
|
17
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
18
|
+
|
|
19
|
+
// packages/core/src/services/console.service.ts
|
|
20
|
+
import { inspect } from "util";
|
|
21
|
+
import { colors, isColorAllowed, yellow } from "../helpers/color.helper.js";
|
|
22
|
+
import { isFunction, isPlainObject, isString, isUndefined } from "../helpers/shared.helper.js";
|
|
23
|
+
import { Injectable } from "../decorators/injectable.decorator.js";
|
|
24
|
+
import { isLogLevelEnabled } from "../helpers/is-log-level-enabled.util.js";
|
|
25
|
+
import { Optional } from "../decorators/optional.decorator.js";
|
|
26
|
+
var DEFAULT_DEPTH = 5;
|
|
27
|
+
var DEFAULT_LOG_LEVELS = ["log", "error", "warn", "debug", "verbose", "fatal"];
|
|
28
|
+
var dateTimeFormatter = new Intl.DateTimeFormat(undefined, {
|
|
29
|
+
year: "numeric",
|
|
30
|
+
hour: "numeric",
|
|
31
|
+
minute: "numeric",
|
|
32
|
+
second: "numeric",
|
|
33
|
+
day: "2-digit",
|
|
34
|
+
month: "2-digit"
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
class ConsoleLogger {
|
|
38
|
+
options;
|
|
39
|
+
context;
|
|
40
|
+
originalContext;
|
|
41
|
+
inspectOptions;
|
|
42
|
+
static lastTimestampAt;
|
|
43
|
+
constructor(contextOrOptions, options) {
|
|
44
|
+
let [context, opts] = isString(contextOrOptions) ? [contextOrOptions, options] : options ? [undefined, options] : [contextOrOptions?.context, contextOrOptions];
|
|
45
|
+
opts = opts ?? {};
|
|
46
|
+
opts.logLevels ??= DEFAULT_LOG_LEVELS;
|
|
47
|
+
opts.colors ??= opts.colors ?? (opts.json ? false : isColorAllowed());
|
|
48
|
+
opts.prefix ??= "Venok";
|
|
49
|
+
this.options = opts;
|
|
50
|
+
this.inspectOptions = this.getInspectOptions();
|
|
51
|
+
if (context) {
|
|
52
|
+
this.context = context;
|
|
53
|
+
this.originalContext = context;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
log(message, ...optionalParams) {
|
|
57
|
+
if (!this.isLevelEnabled("log")) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const { messages, context } = this.getContextAndMessagesToPrint([message, ...optionalParams]);
|
|
61
|
+
this.printMessages(messages, context, "log");
|
|
62
|
+
}
|
|
63
|
+
error(message, ...optionalParams) {
|
|
64
|
+
if (!this.isLevelEnabled("error")) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const { messages, context, stack } = this.getContextAndStackAndMessagesToPrint([message, ...optionalParams]);
|
|
68
|
+
this.printMessages(messages, context, "error", "stderr", stack);
|
|
69
|
+
this.printStackTrace(stack);
|
|
70
|
+
}
|
|
71
|
+
warn(message, ...optionalParams) {
|
|
72
|
+
if (!this.isLevelEnabled("warn")) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const { messages, context } = this.getContextAndMessagesToPrint([message, ...optionalParams]);
|
|
76
|
+
this.printMessages(messages, context, "warn");
|
|
77
|
+
}
|
|
78
|
+
debug(message, ...optionalParams) {
|
|
79
|
+
if (!this.isLevelEnabled("debug")) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const { messages, context } = this.getContextAndMessagesToPrint([message, ...optionalParams]);
|
|
83
|
+
this.printMessages(messages, context, "debug");
|
|
84
|
+
}
|
|
85
|
+
verbose(message, ...optionalParams) {
|
|
86
|
+
if (!this.isLevelEnabled("verbose")) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const { messages, context } = this.getContextAndMessagesToPrint([message, ...optionalParams]);
|
|
90
|
+
this.printMessages(messages, context, "verbose");
|
|
91
|
+
}
|
|
92
|
+
fatal(message, ...optionalParams) {
|
|
93
|
+
if (!this.isLevelEnabled("fatal")) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const { messages, context } = this.getContextAndMessagesToPrint([message, ...optionalParams]);
|
|
97
|
+
this.printMessages(messages, context, "fatal");
|
|
98
|
+
}
|
|
99
|
+
setLogLevels(levels) {
|
|
100
|
+
if (!this.options) {
|
|
101
|
+
this.options = {};
|
|
102
|
+
}
|
|
103
|
+
this.options.logLevels = levels;
|
|
104
|
+
}
|
|
105
|
+
setContext(context) {
|
|
106
|
+
this.context = context;
|
|
107
|
+
}
|
|
108
|
+
resetContext() {
|
|
109
|
+
this.context = this.originalContext;
|
|
110
|
+
}
|
|
111
|
+
isLevelEnabled(level) {
|
|
112
|
+
const logLevels = this.options?.logLevels;
|
|
113
|
+
return isLogLevelEnabled(level, logLevels);
|
|
114
|
+
}
|
|
115
|
+
getTimestamp() {
|
|
116
|
+
return dateTimeFormatter.format(Date.now());
|
|
117
|
+
}
|
|
118
|
+
printMessages(messages, context = "", logLevel = "log", writeStreamType, errorStack) {
|
|
119
|
+
messages.forEach((message) => {
|
|
120
|
+
if (this.options.json) {
|
|
121
|
+
this.printAsJson(message, {
|
|
122
|
+
context,
|
|
123
|
+
logLevel,
|
|
124
|
+
writeStreamType,
|
|
125
|
+
errorStack
|
|
126
|
+
});
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const pidMessage = this.formatPid(process.pid);
|
|
130
|
+
const contextMessage = this.formatContext(context);
|
|
131
|
+
const timestampDiff = this.updateAndGetTimestampDiff();
|
|
132
|
+
const formattedLogLevel = logLevel.toUpperCase().padStart(7, " ");
|
|
133
|
+
const formattedMessage = this.formatMessage(logLevel, message, pidMessage, formattedLogLevel, contextMessage, timestampDiff);
|
|
134
|
+
if (this.options.forceConsole) {
|
|
135
|
+
if (writeStreamType === "stderr") {
|
|
136
|
+
console.error(formattedMessage.trim());
|
|
137
|
+
} else {
|
|
138
|
+
console.log(formattedMessage.trim());
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
process[writeStreamType ?? "stdout"].write(formattedMessage);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
printAsJson(message, options) {
|
|
146
|
+
const logObject = this.getJsonLogObject(message, options);
|
|
147
|
+
const formattedMessage = !this.options.colors && this.inspectOptions.compact === true ? JSON.stringify(logObject, this.stringifyReplacer) : inspect(logObject, this.inspectOptions);
|
|
148
|
+
if (this.options.forceConsole) {
|
|
149
|
+
if (options.writeStreamType === "stderr") {
|
|
150
|
+
console.error(formattedMessage);
|
|
151
|
+
} else {
|
|
152
|
+
console.log(formattedMessage);
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
process[options.writeStreamType ?? "stdout"].write(`${formattedMessage}
|
|
156
|
+
`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
getJsonLogObject(message, options) {
|
|
160
|
+
const logObject = {
|
|
161
|
+
level: options.logLevel,
|
|
162
|
+
pid: process.pid,
|
|
163
|
+
timestamp: Date.now(),
|
|
164
|
+
message
|
|
165
|
+
};
|
|
166
|
+
if (options.context) {
|
|
167
|
+
logObject.context = options.context;
|
|
168
|
+
}
|
|
169
|
+
if (options.errorStack) {
|
|
170
|
+
logObject.stack = options.errorStack;
|
|
171
|
+
}
|
|
172
|
+
return logObject;
|
|
173
|
+
}
|
|
174
|
+
formatPid(pid) {
|
|
175
|
+
return `[${this.options.prefix}] ${pid} - `;
|
|
176
|
+
}
|
|
177
|
+
formatContext(context) {
|
|
178
|
+
if (!context) {
|
|
179
|
+
return "";
|
|
180
|
+
}
|
|
181
|
+
context = `[${context}] `;
|
|
182
|
+
return this.options.colors ? yellow(context) : context;
|
|
183
|
+
}
|
|
184
|
+
formatMessage(logLevel, message, pidMessage, formattedLogLevel, contextMessage, timestampDiff) {
|
|
185
|
+
const output = this.stringifyMessage(message, logLevel);
|
|
186
|
+
pidMessage = this.colorize(pidMessage, logLevel);
|
|
187
|
+
formattedLogLevel = this.colorize(formattedLogLevel, logLevel);
|
|
188
|
+
return `${pidMessage}${this.getTimestamp()} ${formattedLogLevel} ${contextMessage}${output}${timestampDiff}
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
stringifyMessage(message, logLevel) {
|
|
192
|
+
if (isFunction(message)) {
|
|
193
|
+
const messageAsStr = Function.prototype.toString.call(message);
|
|
194
|
+
const isClass = messageAsStr.startsWith("class ");
|
|
195
|
+
if (isClass) {
|
|
196
|
+
return this.stringifyMessage(message.name, logLevel);
|
|
197
|
+
}
|
|
198
|
+
return this.stringifyMessage(message(), logLevel);
|
|
199
|
+
}
|
|
200
|
+
if (typeof message === "string") {
|
|
201
|
+
return this.colorize(message, logLevel);
|
|
202
|
+
}
|
|
203
|
+
const outputText = inspect(message, this.inspectOptions);
|
|
204
|
+
if (isPlainObject(message)) {
|
|
205
|
+
return `Object(${Object.keys(message).length}) ${outputText}`;
|
|
206
|
+
}
|
|
207
|
+
if (Array.isArray(message)) {
|
|
208
|
+
return `Array(${message.length}) ${outputText}`;
|
|
209
|
+
}
|
|
210
|
+
return outputText;
|
|
211
|
+
}
|
|
212
|
+
colorize(message, logLevel) {
|
|
213
|
+
if (!this.options.colors || this.options.json) {
|
|
214
|
+
return message;
|
|
215
|
+
}
|
|
216
|
+
const color = this.getColorByLogLevel(logLevel);
|
|
217
|
+
return color(message);
|
|
218
|
+
}
|
|
219
|
+
printStackTrace(stack) {
|
|
220
|
+
if (!stack || this.options.json) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (this.options.forceConsole) {
|
|
224
|
+
console.error(stack);
|
|
225
|
+
} else {
|
|
226
|
+
process.stderr.write(`${stack}
|
|
227
|
+
`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
updateAndGetTimestampDiff() {
|
|
231
|
+
const includeTimestamp = ConsoleLogger.lastTimestampAt && this.options?.timestamp;
|
|
232
|
+
const result = includeTimestamp ? this.formatTimestampDiff(Date.now() - ConsoleLogger.lastTimestampAt) : "";
|
|
233
|
+
ConsoleLogger.lastTimestampAt = Date.now();
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
formatTimestampDiff(timestampDiff) {
|
|
237
|
+
const formattedDiff = ` +${timestampDiff}ms`;
|
|
238
|
+
return this.options.colors ? yellow(formattedDiff) : formattedDiff;
|
|
239
|
+
}
|
|
240
|
+
getInspectOptions() {
|
|
241
|
+
let breakLength = this.options.breakLength;
|
|
242
|
+
if (typeof breakLength === "undefined") {
|
|
243
|
+
breakLength = this.options.colors ? this.options.compact ? Infinity : undefined : this.options.compact === false ? undefined : Infinity;
|
|
244
|
+
}
|
|
245
|
+
const inspectOptions = {
|
|
246
|
+
depth: this.options.depth ?? DEFAULT_DEPTH,
|
|
247
|
+
sorted: this.options.sorted,
|
|
248
|
+
showHidden: this.options.showHidden,
|
|
249
|
+
compact: this.options.compact ?? (this.options.json ? true : false),
|
|
250
|
+
colors: this.options.colors,
|
|
251
|
+
breakLength
|
|
252
|
+
};
|
|
253
|
+
if (this.options.maxArrayLength) {
|
|
254
|
+
inspectOptions.maxArrayLength = this.options.maxArrayLength;
|
|
255
|
+
}
|
|
256
|
+
if (this.options.maxStringLength) {
|
|
257
|
+
inspectOptions.maxStringLength = this.options.maxStringLength;
|
|
258
|
+
}
|
|
259
|
+
return inspectOptions;
|
|
260
|
+
}
|
|
261
|
+
stringifyReplacer(key, value) {
|
|
262
|
+
if (typeof value === "bigint") {
|
|
263
|
+
return value.toString();
|
|
264
|
+
}
|
|
265
|
+
if (typeof value === "symbol") {
|
|
266
|
+
return value.toString();
|
|
267
|
+
}
|
|
268
|
+
if (value instanceof Map || value instanceof Set || value instanceof Error) {
|
|
269
|
+
return `${inspect(value, this.inspectOptions)}`;
|
|
270
|
+
}
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
273
|
+
getContextAndMessagesToPrint(args) {
|
|
274
|
+
if (args?.length <= 1) {
|
|
275
|
+
return { messages: args, context: this.context };
|
|
276
|
+
}
|
|
277
|
+
const lastElement = args[args.length - 1];
|
|
278
|
+
const isContext = isString(lastElement);
|
|
279
|
+
if (!isContext) {
|
|
280
|
+
return { messages: args, context: this.context };
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
context: lastElement,
|
|
284
|
+
messages: args.slice(0, args.length - 1)
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
getContextAndStackAndMessagesToPrint(args) {
|
|
288
|
+
if (args.length === 2) {
|
|
289
|
+
return this.isStackFormat(args[1]) ? {
|
|
290
|
+
messages: [args[0]],
|
|
291
|
+
stack: args[1],
|
|
292
|
+
context: this.context
|
|
293
|
+
} : {
|
|
294
|
+
messages: [args[0]],
|
|
295
|
+
context: args[1]
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
const { messages, context } = this.getContextAndMessagesToPrint(args);
|
|
299
|
+
if (messages?.length <= 1) {
|
|
300
|
+
return { messages, context };
|
|
301
|
+
}
|
|
302
|
+
const lastElement = messages[messages.length - 1];
|
|
303
|
+
const isStack = isString(lastElement);
|
|
304
|
+
if (!isStack && !isUndefined(lastElement)) {
|
|
305
|
+
return { messages, context };
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
stack: lastElement,
|
|
309
|
+
messages: messages.slice(0, messages.length - 1),
|
|
310
|
+
context
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
isStackFormat(stack) {
|
|
314
|
+
if (!isString(stack) && !isUndefined(stack)) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
return /^(.)+\n\s+at .+:\d+:\d+/.test(stack);
|
|
318
|
+
}
|
|
319
|
+
getColorByLogLevel(level) {
|
|
320
|
+
switch (level) {
|
|
321
|
+
case "debug":
|
|
322
|
+
return colors.magentaBright;
|
|
323
|
+
case "warn":
|
|
324
|
+
return colors.yellow;
|
|
325
|
+
case "error":
|
|
326
|
+
return colors.red;
|
|
327
|
+
case "verbose":
|
|
328
|
+
return colors.cyanBright;
|
|
329
|
+
case "fatal":
|
|
330
|
+
return colors.bold;
|
|
331
|
+
default:
|
|
332
|
+
return colors.green;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
ConsoleLogger = __legacyDecorateClassTS([
|
|
337
|
+
Injectable(),
|
|
338
|
+
__legacyDecorateParamTS(0, Optional()),
|
|
339
|
+
__legacyDecorateParamTS(1, Optional()),
|
|
340
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
341
|
+
Object,
|
|
342
|
+
typeof ConsoleLoggerOptions === "undefined" ? Object : ConsoleLoggerOptions
|
|
343
|
+
])
|
|
344
|
+
], ConsoleLogger);
|
|
345
|
+
export {
|
|
346
|
+
ConsoleLogger
|
|
347
|
+
};
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
5
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else
|
|
7
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
8
|
+
if (d = decorators[i])
|
|
9
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
13
|
+
var __legacyMetadataTS = (k, v) => {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
15
|
+
return Reflect.metadata(k, v);
|
|
16
|
+
};
|
|
17
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
18
|
+
|
|
19
|
+
// packages/core/src/services/logger.service.ts
|
|
20
|
+
import { ConsoleLogger } from "../services/console.service.js";
|
|
21
|
+
import { Injectable } from "../decorators/injectable.decorator.js";
|
|
22
|
+
import { isLogLevelEnabled } from "../helpers/is-log-level-enabled.util.js";
|
|
23
|
+
import { isObject } from "../helpers/shared.helper.js";
|
|
24
|
+
var LOG_LEVELS = ["verbose", "debug", "log", "warn", "error", "fatal"];
|
|
25
|
+
var DEFAULT_LOGGER = new ConsoleLogger;
|
|
26
|
+
var dateTimeFormatter = new Intl.DateTimeFormat(undefined, {
|
|
27
|
+
year: "numeric",
|
|
28
|
+
hour: "numeric",
|
|
29
|
+
minute: "numeric",
|
|
30
|
+
second: "numeric",
|
|
31
|
+
day: "2-digit",
|
|
32
|
+
month: "2-digit"
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
class Logger {
|
|
36
|
+
context;
|
|
37
|
+
options;
|
|
38
|
+
static logBuffer = new Array;
|
|
39
|
+
static staticInstanceRef = DEFAULT_LOGGER;
|
|
40
|
+
static logLevels;
|
|
41
|
+
static isBufferAttached;
|
|
42
|
+
localInstanceRef;
|
|
43
|
+
static WrapBuffer = (target, propertyKey, descriptor) => {
|
|
44
|
+
const originalFn = descriptor.value;
|
|
45
|
+
descriptor.value = function(...args) {
|
|
46
|
+
if (Logger.isBufferAttached) {
|
|
47
|
+
Logger.logBuffer.push({
|
|
48
|
+
methodRef: originalFn.bind(this),
|
|
49
|
+
arguments: args
|
|
50
|
+
});
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
return originalFn.call(this, ...args);
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
constructor(context, options = {}) {
|
|
57
|
+
this.context = context;
|
|
58
|
+
this.options = options;
|
|
59
|
+
}
|
|
60
|
+
get localInstance() {
|
|
61
|
+
if (Logger.staticInstanceRef === DEFAULT_LOGGER) {
|
|
62
|
+
return this.registerLocalInstanceRef();
|
|
63
|
+
} else if (Logger.staticInstanceRef instanceof Logger) {
|
|
64
|
+
const prototype = Object.getPrototypeOf(Logger.staticInstanceRef);
|
|
65
|
+
if (prototype.constructor === Logger) {
|
|
66
|
+
return this.registerLocalInstanceRef();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return Logger.staticInstanceRef;
|
|
70
|
+
}
|
|
71
|
+
error(message, ...optionalParams) {
|
|
72
|
+
optionalParams = this.context ? (optionalParams.length ? optionalParams : [undefined]).concat(this.context) : optionalParams;
|
|
73
|
+
this.localInstance?.error(message, ...optionalParams);
|
|
74
|
+
}
|
|
75
|
+
log(message, ...optionalParams) {
|
|
76
|
+
optionalParams = this.context ? optionalParams.concat(this.context) : optionalParams;
|
|
77
|
+
this.localInstance?.log(message, ...optionalParams);
|
|
78
|
+
}
|
|
79
|
+
warn(message, ...optionalParams) {
|
|
80
|
+
optionalParams = this.context ? optionalParams.concat(this.context) : optionalParams;
|
|
81
|
+
this.localInstance?.warn(message, ...optionalParams);
|
|
82
|
+
}
|
|
83
|
+
debug(message, ...optionalParams) {
|
|
84
|
+
optionalParams = this.context ? optionalParams.concat(this.context) : optionalParams;
|
|
85
|
+
this.localInstance?.debug?.(message, ...optionalParams);
|
|
86
|
+
}
|
|
87
|
+
verbose(message, ...optionalParams) {
|
|
88
|
+
optionalParams = this.context ? optionalParams.concat(this.context) : optionalParams;
|
|
89
|
+
this.localInstance?.verbose?.(message, ...optionalParams);
|
|
90
|
+
}
|
|
91
|
+
fatal(message, ...optionalParams) {
|
|
92
|
+
optionalParams = this.context ? optionalParams.concat(this.context) : optionalParams;
|
|
93
|
+
this.localInstance?.fatal?.(message, ...optionalParams);
|
|
94
|
+
}
|
|
95
|
+
static error(message, ...optionalParams) {
|
|
96
|
+
this.staticInstanceRef?.error(message, ...optionalParams);
|
|
97
|
+
}
|
|
98
|
+
static log(message, ...optionalParams) {
|
|
99
|
+
this.staticInstanceRef?.log(message, ...optionalParams);
|
|
100
|
+
}
|
|
101
|
+
static warn(message, ...optionalParams) {
|
|
102
|
+
this.staticInstanceRef?.warn(message, ...optionalParams);
|
|
103
|
+
}
|
|
104
|
+
static debug(message, ...optionalParams) {
|
|
105
|
+
this.staticInstanceRef?.debug?.(message, ...optionalParams);
|
|
106
|
+
}
|
|
107
|
+
static verbose(message, ...optionalParams) {
|
|
108
|
+
this.staticInstanceRef?.verbose?.(message, ...optionalParams);
|
|
109
|
+
}
|
|
110
|
+
static fatal(message, ...optionalParams) {
|
|
111
|
+
this.staticInstanceRef?.fatal?.(message, ...optionalParams);
|
|
112
|
+
}
|
|
113
|
+
static flush() {
|
|
114
|
+
this.isBufferAttached = false;
|
|
115
|
+
this.logBuffer.forEach((item) => item.methodRef(...item.arguments));
|
|
116
|
+
this.logBuffer = [];
|
|
117
|
+
}
|
|
118
|
+
static attachBuffer() {
|
|
119
|
+
this.isBufferAttached = true;
|
|
120
|
+
}
|
|
121
|
+
static detachBuffer() {
|
|
122
|
+
this.isBufferAttached = false;
|
|
123
|
+
}
|
|
124
|
+
static getTimestamp() {
|
|
125
|
+
return dateTimeFormatter.format(Date.now());
|
|
126
|
+
}
|
|
127
|
+
static overrideLogger(logger) {
|
|
128
|
+
if (Array.isArray(logger)) {
|
|
129
|
+
Logger.logLevels = logger;
|
|
130
|
+
return this.staticInstanceRef?.setLogLevels?.(logger);
|
|
131
|
+
}
|
|
132
|
+
if (isObject(logger)) {
|
|
133
|
+
if (logger instanceof Logger && logger.constructor !== Logger) {
|
|
134
|
+
const errorMessage = `Using the "extends Logger" instruction is not allowed in Nest v9. Please, use "extends ConsoleLogger" instead.`;
|
|
135
|
+
this.staticInstanceRef?.error(errorMessage);
|
|
136
|
+
throw new Error(errorMessage);
|
|
137
|
+
}
|
|
138
|
+
this.staticInstanceRef = logger;
|
|
139
|
+
} else {
|
|
140
|
+
this.staticInstanceRef = undefined;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
static isLevelEnabled(level) {
|
|
144
|
+
const logLevels = Logger.logLevels;
|
|
145
|
+
return isLogLevelEnabled(level, logLevels);
|
|
146
|
+
}
|
|
147
|
+
registerLocalInstanceRef() {
|
|
148
|
+
if (this.localInstanceRef) {
|
|
149
|
+
return this.localInstanceRef;
|
|
150
|
+
}
|
|
151
|
+
this.localInstanceRef = new ConsoleLogger(this.context, {
|
|
152
|
+
timestamp: this.options?.timestamp,
|
|
153
|
+
logLevels: Logger.logLevels
|
|
154
|
+
});
|
|
155
|
+
return this.localInstanceRef;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
__legacyDecorateClassTS([
|
|
159
|
+
Logger.WrapBuffer,
|
|
160
|
+
__legacyMetadataTS("design:type", Function),
|
|
161
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
162
|
+
Object,
|
|
163
|
+
Object
|
|
164
|
+
]),
|
|
165
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
166
|
+
], Logger.prototype, "error", null);
|
|
167
|
+
__legacyDecorateClassTS([
|
|
168
|
+
Logger.WrapBuffer,
|
|
169
|
+
__legacyMetadataTS("design:type", Function),
|
|
170
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
171
|
+
Object,
|
|
172
|
+
Object
|
|
173
|
+
]),
|
|
174
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
175
|
+
], Logger.prototype, "log", null);
|
|
176
|
+
__legacyDecorateClassTS([
|
|
177
|
+
Logger.WrapBuffer,
|
|
178
|
+
__legacyMetadataTS("design:type", Function),
|
|
179
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
180
|
+
Object,
|
|
181
|
+
Object
|
|
182
|
+
]),
|
|
183
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
184
|
+
], Logger.prototype, "warn", null);
|
|
185
|
+
__legacyDecorateClassTS([
|
|
186
|
+
Logger.WrapBuffer,
|
|
187
|
+
__legacyMetadataTS("design:type", Function),
|
|
188
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
189
|
+
Object,
|
|
190
|
+
Object
|
|
191
|
+
]),
|
|
192
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
193
|
+
], Logger.prototype, "debug", null);
|
|
194
|
+
__legacyDecorateClassTS([
|
|
195
|
+
Logger.WrapBuffer,
|
|
196
|
+
__legacyMetadataTS("design:type", Function),
|
|
197
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
198
|
+
Object,
|
|
199
|
+
Object
|
|
200
|
+
]),
|
|
201
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
202
|
+
], Logger.prototype, "verbose", null);
|
|
203
|
+
__legacyDecorateClassTS([
|
|
204
|
+
Logger.WrapBuffer,
|
|
205
|
+
__legacyMetadataTS("design:type", Function),
|
|
206
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
207
|
+
Object,
|
|
208
|
+
Object
|
|
209
|
+
]),
|
|
210
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
211
|
+
], Logger.prototype, "fatal", null);
|
|
212
|
+
__legacyDecorateClassTS([
|
|
213
|
+
Logger.WrapBuffer,
|
|
214
|
+
__legacyMetadataTS("design:type", Function),
|
|
215
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
216
|
+
Object,
|
|
217
|
+
Object
|
|
218
|
+
]),
|
|
219
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
220
|
+
], Logger, "error", null);
|
|
221
|
+
__legacyDecorateClassTS([
|
|
222
|
+
Logger.WrapBuffer,
|
|
223
|
+
__legacyMetadataTS("design:type", Function),
|
|
224
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
225
|
+
Object,
|
|
226
|
+
Object
|
|
227
|
+
]),
|
|
228
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
229
|
+
], Logger, "log", null);
|
|
230
|
+
__legacyDecorateClassTS([
|
|
231
|
+
Logger.WrapBuffer,
|
|
232
|
+
__legacyMetadataTS("design:type", Function),
|
|
233
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
234
|
+
Object,
|
|
235
|
+
Object
|
|
236
|
+
]),
|
|
237
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
238
|
+
], Logger, "warn", null);
|
|
239
|
+
__legacyDecorateClassTS([
|
|
240
|
+
Logger.WrapBuffer,
|
|
241
|
+
__legacyMetadataTS("design:type", Function),
|
|
242
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
243
|
+
Object,
|
|
244
|
+
Object
|
|
245
|
+
]),
|
|
246
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
247
|
+
], Logger, "debug", null);
|
|
248
|
+
__legacyDecorateClassTS([
|
|
249
|
+
Logger.WrapBuffer,
|
|
250
|
+
__legacyMetadataTS("design:type", Function),
|
|
251
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
252
|
+
Object,
|
|
253
|
+
Object
|
|
254
|
+
]),
|
|
255
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
256
|
+
], Logger, "verbose", null);
|
|
257
|
+
__legacyDecorateClassTS([
|
|
258
|
+
Logger.WrapBuffer,
|
|
259
|
+
__legacyMetadataTS("design:type", Function),
|
|
260
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
261
|
+
Object,
|
|
262
|
+
Object
|
|
263
|
+
]),
|
|
264
|
+
__legacyMetadataTS("design:returntype", undefined)
|
|
265
|
+
], Logger, "fatal", null);
|
|
266
|
+
Logger = __legacyDecorateClassTS([
|
|
267
|
+
Injectable(),
|
|
268
|
+
__legacyMetadataTS("design:paramtypes", [
|
|
269
|
+
String,
|
|
270
|
+
Object
|
|
271
|
+
])
|
|
272
|
+
], Logger);
|
|
273
|
+
export {
|
|
274
|
+
Logger,
|
|
275
|
+
LOG_LEVELS
|
|
276
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
5
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
6
|
+
else
|
|
7
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
8
|
+
if (d = decorators[i])
|
|
9
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __legacyDecorateParamTS = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
13
|
+
var __legacyMetadataTS = (k, v) => {
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
15
|
+
return Reflect.metadata(k, v);
|
|
16
|
+
};
|
|
17
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
18
|
+
|
|
19
|
+
// packages/core/src/services/reflector.service.ts
|
|
20
|
+
import { uid } from "uid";
|
|
21
|
+
import { SetMetadata } from "../decorators/set-metadata.decorator.js";
|
|
22
|
+
import { isEmpty, isObject } from "../helpers/shared.helper.js";
|
|
23
|
+
|
|
24
|
+
class Reflector {
|
|
25
|
+
static reflector = new Reflector;
|
|
26
|
+
static createDecorator(options = {}) {
|
|
27
|
+
const metadataKey = options.key ?? uid(21);
|
|
28
|
+
const decoratorFn = (metadataValue) => (target, key, descriptor) => {
|
|
29
|
+
const value = options.transform ? options.transform(metadataValue) : metadataValue;
|
|
30
|
+
SetMetadata(metadataKey, value ?? undefined, options.type)(target, key, descriptor);
|
|
31
|
+
};
|
|
32
|
+
decoratorFn.KEY = metadataKey;
|
|
33
|
+
return decoratorFn;
|
|
34
|
+
}
|
|
35
|
+
static createMetadataDecorator(options) {
|
|
36
|
+
const metadataKey = options.key ?? uid(21);
|
|
37
|
+
const decoratorFn = (metadataValue) => (target, key, descriptor) => {
|
|
38
|
+
const value = options.transform(metadataValue);
|
|
39
|
+
for (const [additionalKey, additionalValue] of Object.entries(value)) {
|
|
40
|
+
SetMetadata(additionalKey, additionalValue ?? undefined, options.type)(target, key, descriptor);
|
|
41
|
+
}
|
|
42
|
+
SetMetadata(metadataKey, true, options.type)(target, key, descriptor);
|
|
43
|
+
};
|
|
44
|
+
decoratorFn.KEY = metadataKey;
|
|
45
|
+
return decoratorFn;
|
|
46
|
+
}
|
|
47
|
+
constructor() {}
|
|
48
|
+
has(metadataKeyOrDecorator, target) {
|
|
49
|
+
const metadataKey = metadataKeyOrDecorator.KEY ?? metadataKeyOrDecorator;
|
|
50
|
+
return Reflect.hasMetadata(metadataKey, target);
|
|
51
|
+
}
|
|
52
|
+
get(metadataKeyOrDecorator, target) {
|
|
53
|
+
const metadataKey = metadataKeyOrDecorator.KEY ?? metadataKeyOrDecorator;
|
|
54
|
+
return Reflect.getMetadata(metadataKey, target);
|
|
55
|
+
}
|
|
56
|
+
getAll(metadataKeyOrDecorator, targets) {
|
|
57
|
+
return (targets || []).map((target) => this.get(metadataKeyOrDecorator, target));
|
|
58
|
+
}
|
|
59
|
+
getAllAndMerge(metadataKeyOrDecorator, targets) {
|
|
60
|
+
const metadataCollection = this.getAll(metadataKeyOrDecorator, targets).filter(Boolean);
|
|
61
|
+
if (isEmpty(metadataCollection))
|
|
62
|
+
return metadataCollection;
|
|
63
|
+
return metadataCollection.reduce((a, b) => {
|
|
64
|
+
if (Array.isArray(a))
|
|
65
|
+
return a.concat(b);
|
|
66
|
+
if (isObject(a) && isObject(b))
|
|
67
|
+
return { ...a, ...b };
|
|
68
|
+
return [a, b];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
getAllAndOverride(metadataKeyOrDecorator, targets) {
|
|
72
|
+
for (const target of targets) {
|
|
73
|
+
const result = this.get(metadataKeyOrDecorator, target);
|
|
74
|
+
if (result !== undefined)
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
Reflector
|
|
82
|
+
};
|