Socket
Socket
Sign inDemoInstall

knifecycle

Package Overview
Dependencies
Maintainers
1
Versions
100
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 4.2.0 to 4.3.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

# [4.3.0](https://github.com/nfroidure/knifecycle/compare/v4.2.0...v4.3.0) (2018-11-10)
### Features
* **autoInject util:** Allow to auto inject even with multi-args functions ([bdf4e8b](https://github.com/nfroidure/knifecycle/commit/bdf4e8b))
# [4.2.0](https://github.com/nfroidure/knifecycle/compare/v4.1.0...v4.2.0) (2018-11-10)

@@ -2,0 +11,0 @@

2

dist/util.js

@@ -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*\(\{\s*([^{}}]+)\s*\}[^()]*\)/);

@@ -186,0 +186,0 @@ if (!matches) {

@@ -177,2 +177,27 @@ "use strict";

});
it('should allow to decorate an initializer with several arguments', () => {
const noop = () => {};
const baseProvider = async ({
ENV,
log = noop,
debug: aDebug = () => ''
}, {
userId
}) => async () => ({
ENV,
log,
aDebug,
userId
});
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 too complex injections', () => {

@@ -179,0 +204,0 @@ _assert.default.throws(() => {

{
"name": "knifecycle",
"version": "4.2.0",
"version": "4.3.0",
"description": "Manage your NodeJS processes's lifecycle.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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