knifecycle
Advanced tools
Comparing version 4.3.0 to 4.3.1
@@ -0,1 +1,10 @@ | ||
## [4.3.1](https://github.com/nfroidure/knifecycle/compare/v4.3.0...v4.3.1) (2018-11-10) | ||
### Bug Fixes | ||
* **autoInject util:** Fix autoInject for named functions ([b3b8c10](https://github.com/nfroidure/knifecycle/commit/b3b8c10)) | ||
# [4.3.0](https://github.com/nfroidure/knifecycle/compare/v4.2.0...v4.3.0) (2018-11-10) | ||
@@ -2,0 +11,0 @@ |
@@ -183,3 +183,3 @@ "use strict"; | ||
const source = initializer.toString(); | ||
const matches = source.match(/^\s*async\s+(?:function)?\s*\(\{\s*([^{}}]+)\s*\}[^()]*\)/); | ||
const matches = source.match(/^\s*async\s+(?:function)?\s*\w*\s*\(\{\s*([^{}}]+)\s*\}[^()]*\)/); | ||
@@ -186,0 +186,0 @@ if (!matches) { |
@@ -155,2 +155,22 @@ "use strict"; | ||
}); | ||
it('should allow to decorate an initializer with a function name', () => { | ||
async function baseProvider({ | ||
ENV, | ||
mysql: db | ||
}) { | ||
async () => ({ | ||
ENV, | ||
db | ||
}); | ||
} | ||
const dependencies = ['ENV', 'mysql']; | ||
const newInitializer = (0, _util.autoInject)(baseProvider); | ||
_assert.default.notEqual(newInitializer, baseProvider); | ||
_assert.default.notEqual(newInitializer[_util.SPECIAL_PROPS.INJECT], dependencies); | ||
_assert.default.deepEqual(newInitializer[_util.SPECIAL_PROPS.INJECT], dependencies); | ||
}); | ||
it('should allow to decorate an initializer with optional dependencies', () => { | ||
@@ -157,0 +177,0 @@ const noop = () => {}; |
{ | ||
"name": "knifecycle", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "Manage your NodeJS processes's lifecycle.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
184557
3217