Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

knifecycle

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knifecycle - npm Package Compare versions

Comparing version 7.0.0 to 7.0.2

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## [7.0.2](https://github.com/nfroidure/knifecycle/compare/v7.0.1...v7.0.2) (2019-12-01)
## [7.0.1](https://github.com/nfroidure/knifecycle/compare/v7.0.0...v7.0.1) (2019-12-01)
# [7.0.0](https://github.com/nfroidure/knifecycle/compare/v6.0.0...v7.0.0) (2019-11-28)

@@ -2,0 +10,0 @@

@@ -641,2 +641,6 @@ "use strict";

if (serviceDescriptorPromise) {
if (autoloading) {
debug(`⚠️ - Possible dead lock due to reusing "${serviceName}" from the silo context while autoloading.`);
}
return serviceDescriptorPromise;

@@ -652,2 +656,6 @@ }

if (serviceDescriptorPromise) {
if (autoloading) {
debug(`⚠️ - Possible dead lock due to reusing the singleton "${serviceName}" while autoloading.`);
}
this._singletonsServicesHandles.get(serviceName).add(siloContext.name);

@@ -654,0 +662,0 @@ } else {

51

dist/index.mocha.js

@@ -791,3 +791,3 @@ "use strict";

});
it('should fail when autoload depends on autoloaded/unexisting dependencies', async () => {
it('should fail when autoload depends on existing autoloaded dependencies', async () => {
$.register((0, _index.initializer)({

@@ -818,2 +818,51 @@ type: 'service',

});
it('should work when autoload depends on optional and unexisting autoloaded dependencies', async () => {
$.register((0, _index.initializer)({
type: 'service',
name: '$autoload',
inject: ['?ENV'],
options: {
singleton: true
}
}, async () => async serviceName => ({
path: `/path/of/${serviceName}`,
initializer: (0, _index.initializer)({
type: 'service',
name: serviceName,
inject: []
}, async () => `THE_${serviceName.toUpperCase()}:` + serviceName)
})));
const dependencies = await $.run(['test']);
_assert.default.deepEqual(Object.keys(dependencies), ['test']);
});
it.skip('should work when autoload depends on deeper optional and unexisting autoloaded dependencies', async () => {
$.register((0, _index.initializer)({
type: 'service',
name: 'log',
inject: ['?LOG_ROUTING', '?LOGGER', '?debug']
}, async () => {
return function log() {};
}));
$.register((0, _index.constant)('LOGGER', 'LOGGER_CONSTANT'));
$.register((0, _index.constant)('debug', 'debug_value'));
$.register((0, _index.initializer)({
type: 'service',
name: '$autoload',
inject: ['?ENV', '?log'],
options: {
singleton: true
}
}, async () => async serviceName => ({
path: `/path/of/${serviceName}`,
initializer: (0, _index.initializer)({
type: 'service',
name: serviceName,
inject: []
}, async () => `THE_${serviceName.toUpperCase()}:` + serviceName)
})));
const dependencies = await $.run(['test', 'log']);
_assert.default.deepEqual(Object.keys(dependencies), ['test', 'log']);
});
});

@@ -820,0 +869,0 @@ describe('$injector', () => {

4

package.json
{
"name": "knifecycle",
"version": "7.0.0",
"version": "7.0.2",
"description": "Manage your NodeJS processes's lifecycle automatically with an unobtrusive dependency injection implementation.",

@@ -102,3 +102,3 @@ "main": "dist/index.js",

"metapak": "^3.1.6",
"metapak-nfroidure": "9.7.2",
"metapak-nfroidure": "9.7.4",
"mocha": "^6.2.0",

@@ -105,0 +105,0 @@ "nyc": "^14.1.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc