@lad-tech/nsc-toolkit 1.15.1 → 1.15.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [1.15.1](https://github.com/lad-tech/nsc-toolkit/compare/v1.15.0...v1.15.1) (2023-08-16)
1
+ ## [1.15.2](https://github.com/lad-tech/nsc-toolkit/compare/v1.15.1...v1.15.2) (2023-08-16)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * singlton inject ([9627f1c](https://github.com/lad-tech/nsc-toolkit/commit/9627f1c6c5b82e73b910a8480697dcafa1abd14f))
6
+ * singlton inject ([#75](https://github.com/lad-tech/nsc-toolkit/issues/75)) ([b57e386](https://github.com/lad-tech/nsc-toolkit/commit/b57e386532d32a3ea2bbf9940d8c2b4ae6fa85ab))
package/dist/Service.js CHANGED
@@ -128,12 +128,12 @@ class Service extends Root_1.Root {
128
128
  if (Array.isArray(dependencyKey)) {
129
129
  if (propertyName === _1.ConstructorDependencyKey) {
130
130
  dependencyKey.forEach((item, index) => {
131
- const { dependency, constructor } = _1.container.get(item);
131
+ const { dependency } = _1.container.get(item);
132
132
  if (dependency.type === _1.DependencyType.SERVICE) {
133
133
  dependences[_1.ConstructorDependencyKey][index] = new dependency.value(this.broker, baggage, this.options.cache);
134
134
  }
135
135
  if (dependency.type === _1.DependencyType.ADAPTER) {
136
- const instance = new dependency.value(...constructor);
136
+ const instance = _1.container.getInstance(item);
137
137
  const trap = this.getTrap(instance, tracer, baggage);
138
138
  dependences[_1.ConstructorDependencyKey][index] = new Proxy(instance, trap);
139
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lad-tech/nsc-toolkit",
3
- "version": "1.15.1",
3
+ "version": "1.15.2",
4
4
  "description": "Toolkit for create microservices around NATS",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",