knifecycle
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -0,1 +1,11 @@ | ||
<a name="2.1.1"></a> | ||
## [2.1.1](https://github.com/nfroidure/knifecycle/compare/v2.1.0...v2.1.1) (2017-06-15) | ||
### Bug Fixes | ||
* **Mappings:** Fix the mappings for the initial run ([2cfdb7f](https://github.com/nfroidure/knifecycle/commit/2cfdb7f)) | ||
<a name="2.1.0"></a> | ||
@@ -2,0 +12,0 @@ # [2.1.0](https://github.com/nfroidure/knifecycle/compare/v2.0.0...v2.1.0) (2017-06-04) |
@@ -334,3 +334,3 @@ 'use strict'; | ||
var serviceName = _pickMappedNameFromDeclaration(dependencyDeclaration); | ||
var serviceName = _pickServiceNameFromDeclaration(dependencyDeclaration); | ||
var dependencyProvider = this._servicesProviders.get(serviceName); | ||
@@ -343,3 +343,3 @@ | ||
dependencyProvider[_util.SPECIAL_PROPS.INJECT].forEach(function (childDependencyDeclaration) { | ||
var childServiceName = _pickMappedNameFromDeclaration(childDependencyDeclaration); | ||
var childServiceName = _pickServiceNameFromDeclaration(childDependencyDeclaration); | ||
@@ -547,5 +547,7 @@ if (rootServiceName === childServiceName) { | ||
return dependenciesDeclarations.reduce(function (finalHash, dependencyDeclaration) { | ||
var serviceName = _pickServiceNameFromDeclaration(dependencyDeclaration); | ||
var _parseDependencyDecla = (0, _util.parseDependencyDeclaration)(dependencyDeclaration), | ||
serviceName = _parseDependencyDecla.serviceName, | ||
mappedName = _parseDependencyDecla.mappedName; | ||
finalHash[serviceName] = servicesHash[serviceName]; | ||
finalHash[mappedName] = servicesHash[serviceName]; | ||
return finalHash; | ||
@@ -680,5 +682,5 @@ }, {}); | ||
return Promise.all(servicesDeclarations.map(function (serviceDeclaration) { | ||
var _parseDependencyDecla = (0, _util.parseDependencyDeclaration)(serviceDeclaration), | ||
mappedName = _parseDependencyDecla.mappedName, | ||
optional = _parseDependencyDecla.optional; | ||
var _parseDependencyDecla2 = (0, _util.parseDependencyDeclaration)(serviceDeclaration), | ||
mappedName = _parseDependencyDecla2.mappedName, | ||
optional = _parseDependencyDecla2.optional; | ||
@@ -702,5 +704,5 @@ return _this7._getServiceDescriptor(siloContext, injectOnly, mappedName).catch(function (err) { | ||
return services.reduce(function (hash, service, index) { | ||
var serviceName = _pickServiceNameFromDeclaration(servicesDeclarations[index]); | ||
var mappedName = _pickMappedNameFromDeclaration(servicesDeclarations[index]); | ||
hash[serviceName] = service; | ||
hash[mappedName] = service; | ||
return hash; | ||
@@ -734,4 +736,4 @@ }, {}); | ||
function _pickServiceNameFromDeclaration(dependencyDeclaration) { | ||
var _parseDependencyDecla2 = (0, _util.parseDependencyDeclaration)(dependencyDeclaration), | ||
serviceName = _parseDependencyDecla2.serviceName; | ||
var _parseDependencyDecla3 = (0, _util.parseDependencyDeclaration)(dependencyDeclaration), | ||
serviceName = _parseDependencyDecla3.serviceName; | ||
@@ -742,5 +744,5 @@ return serviceName; | ||
function _pickMappedNameFromDeclaration(dependencyDeclaration) { | ||
var _parseDependencyDecla3 = (0, _util.parseDependencyDeclaration)(dependencyDeclaration), | ||
serviceName = _parseDependencyDecla3.serviceName, | ||
mappedName = _parseDependencyDecla3.mappedName; | ||
var _parseDependencyDecla4 = (0, _util.parseDependencyDeclaration)(dependencyDeclaration), | ||
serviceName = _parseDependencyDecla4.serviceName, | ||
mappedName = _parseDependencyDecla4.mappedName; | ||
@@ -747,0 +749,0 @@ return mappedName || serviceName; |
@@ -131,9 +131,9 @@ 'use strict'; | ||
_assert2.default.throws(function () { | ||
$.provider('aHash', (0, _index.inject)(['hash3>aHash3'], hashProvider)); | ||
$.provider('aHash1', (0, _index.inject)(['hash>aHash'], hashProvider)); | ||
$.provider('aHash2', (0, _index.inject)(['hash1>aHash1'], hashProvider)); | ||
$.provider('aHash3', (0, _index.inject)(['hash>aHash'], hashProvider)); | ||
$.provider('hash', (0, _index.inject)(['hash3>aHash3'], hashProvider)); | ||
$.provider('hash1', (0, _index.inject)(['hash>aHash'], hashProvider)); | ||
$.provider('hash2', (0, _index.inject)(['hash1>aHash1'], hashProvider)); | ||
$.provider('hash3', (0, _index.inject)(['hash>aHash'], hashProvider)); | ||
}, function (err) { | ||
_assert2.default.deepEqual(err.code, 'E_CIRCULAR_DEPENDENCY'); | ||
_assert2.default.deepEqual(err.params, ['aHash3', 'hash>aHash', 'hash3>aHash3']); | ||
_assert2.default.deepEqual(err.params, ['hash3', 'hash>aHash', 'hash3>aHash3']); | ||
return true; | ||
@@ -376,3 +376,3 @@ }); | ||
$.run(['hash2>aHash2', 'hash3>aHash3', 'time>aTime']).then(function (dependencies) { | ||
_assert2.default.deepEqual(Object.keys(dependencies), ['hash2', 'hash3', 'time']); | ||
_assert2.default.deepEqual(Object.keys(dependencies), ['aHash2', 'aHash3', 'aTime']); | ||
_assert2.default.deepEqual(timeServiceStub.args, [[{}]]); | ||
@@ -379,0 +379,0 @@ }).then(function () { |
{ | ||
"name": "knifecycle", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Manage your NodeJS processes's lifecycle.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -362,3 +362,3 @@ /* eslint max-len: ["warn", { "ignoreComments": true }] */ | ||
) { | ||
const serviceName = _pickMappedNameFromDeclaration( | ||
const serviceName = _pickServiceNameFromDeclaration( | ||
dependencyDeclaration | ||
@@ -374,3 +374,3 @@ ); | ||
.forEach((childDependencyDeclaration) => { | ||
const childServiceName = _pickMappedNameFromDeclaration( | ||
const childServiceName = _pickServiceNameFromDeclaration( | ||
childDependencyDeclaration | ||
@@ -619,6 +619,6 @@ ); | ||
(finalHash, dependencyDeclaration) => { | ||
const serviceName = | ||
_pickServiceNameFromDeclaration(dependencyDeclaration); | ||
const { serviceName, mappedName } = | ||
parseDependencyDeclaration(dependencyDeclaration); | ||
finalHash[serviceName] = servicesHash[serviceName]; | ||
finalHash[mappedName] = servicesHash[serviceName]; | ||
return finalHash; | ||
@@ -806,7 +806,7 @@ }, {} | ||
.then(services => services.reduce((hash, service, index) => { | ||
const serviceName = _pickServiceNameFromDeclaration( | ||
const mappedName = _pickMappedNameFromDeclaration( | ||
servicesDeclarations[index] | ||
); | ||
hash[serviceName] = service; | ||
hash[mappedName] = service; | ||
return hash; | ||
@@ -813,0 +813,0 @@ }, {})) |
@@ -131,9 +131,9 @@ /* eslint max-nested-callbacks:0 */ | ||
assert.throws(() => { | ||
$.provider('aHash', inject(['hash3>aHash3'], hashProvider)); | ||
$.provider('aHash1', inject(['hash>aHash'], hashProvider)); | ||
$.provider('aHash2', inject(['hash1>aHash1'], hashProvider)); | ||
$.provider('aHash3', inject(['hash>aHash'], hashProvider)); | ||
$.provider('hash', inject(['hash3>aHash3'], hashProvider)); | ||
$.provider('hash1', inject(['hash>aHash'], hashProvider)); | ||
$.provider('hash2', inject(['hash1>aHash1'], hashProvider)); | ||
$.provider('hash3', inject(['hash>aHash'], hashProvider)); | ||
}, (err) => { | ||
assert.deepEqual(err.code, 'E_CIRCULAR_DEPENDENCY'); | ||
assert.deepEqual(err.params, ['aHash3', 'hash>aHash', 'hash3>aHash3']); | ||
assert.deepEqual(err.params, ['hash3', 'hash>aHash', 'hash3>aHash3']); | ||
return true; | ||
@@ -407,3 +407,3 @@ }); | ||
.then((dependencies) => { | ||
assert.deepEqual(Object.keys(dependencies), ['hash2', 'hash3', 'time']); | ||
assert.deepEqual(Object.keys(dependencies), ['aHash2', 'aHash3', 'aTime']); | ||
assert.deepEqual(timeServiceStub.args, [[{}]]); | ||
@@ -410,0 +410,0 @@ }) |
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
195206
4017