knifecycle
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -0,1 +1,10 @@ | ||
## [5.0.1](https://github.com/nfroidure/knifecycle/compare/v5.0.0...v5.0.1) (2018-11-22) | ||
### Bug Fixes | ||
* **autoInject:** Remove unecessary check in the autoInject regExp ([fff9a6f](https://github.com/nfroidure/knifecycle/commit/fff9a6f)) | ||
# [5.0.0](https://github.com/nfroidure/knifecycle/compare/v4.3.1...v5.0.0) (2018-11-18) | ||
@@ -2,0 +11,0 @@ |
@@ -186,3 +186,3 @@ "use strict"; | ||
const source = initializer.toString(); | ||
const matches = source.match(/^\s*(?:async\s+function(?:\s+\w+)?|async)\s*\(\{\s*([^{}}]+)\s*\}[^()]*\)/); | ||
const matches = source.match(/^\s*(?:async\s+function(?:\s+\w+)?|async)\s*\(\{\s*([^{}}]+)\s*\}/); | ||
@@ -189,0 +189,0 @@ if (!matches) { |
@@ -231,2 +231,29 @@ "use strict"; | ||
}); | ||
it('should allow to decorate an initializer with complex arguments', () => { | ||
const noop = () => {}; | ||
const baseProvider = async ({ | ||
ENV, | ||
log = noop, | ||
debug: aDebug = noop | ||
}, { | ||
userId, | ||
currentTime = Date.now() | ||
}) => async () => ({ | ||
ENV, | ||
log, | ||
aDebug, | ||
userId, | ||
currentTime | ||
}); | ||
const dependencies = ['ENV', '?log', '?debug']; | ||
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 fail with non async initializers', () => { | ||
@@ -233,0 +260,0 @@ _assert.default.throws(() => { |
{ | ||
"name": "knifecycle", | ||
"version": "5.0.0", | ||
"version": "5.0.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
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
199842
1669
3531
0
102
2
2
4