ioc-service-container
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -8,9 +8,15 @@ # Changelog | ||
## [1.5.1] - 2021-07.29 | ||
## [1.5.2] - 2021-11-08 | ||
### Fixed | ||
* Fixed an error in ServiceContainer.set() which did not build references instantly if required | ||
## [1.5.1] - 2021-07-29 | ||
### Fixed | ||
* Fixed an error in ServiceContainer.set() which not detected constructable classes | ||
## [1.5.0] - 2021-07.29 | ||
## [1.5.0] - 2021-07-29 | ||
@@ -17,0 +23,0 @@ * You are now able to initialize a class only by its reference |
@@ -16,10 +16,9 @@ "use strict"; | ||
} | ||
let factory = undefined; | ||
if (isConstructable(factoryOrClassReference)) { | ||
factory = () => new factoryOrClassReference(); | ||
} | ||
let factory = isConstructable(factoryOrClassReference) | ||
? () => new factoryOrClassReference() | ||
: factoryOrClassReference; | ||
services.push({ | ||
id: lowerId, | ||
factory: factory || factoryOrClassReference, | ||
instance: buildInstantly ? factoryOrClassReference() : undefined, | ||
factory, | ||
instance: buildInstantly ? factory() : undefined, | ||
}); | ||
@@ -26,0 +25,0 @@ }, |
{ | ||
"name": "ioc-service-container", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "Lightweight ioc service container", | ||
@@ -16,8 +16,8 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/jest": "^26.0.24", | ||
"jest": "^27.0.6", | ||
"@types/jest": "^27.0.2", | ||
"jest": "^27.3.1", | ||
"sonarqube-scanner": "^2.8.1", | ||
"ts-jest": "^27.0.4", | ||
"ts-node": "^10.1.0", | ||
"typescript": "^4.3.5" | ||
"ts-jest": "^27.0.7", | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.4.4" | ||
}, | ||
@@ -24,0 +24,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15135
131