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

dependency-injection

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-injection - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

18

lib/Helpers.js

@@ -117,3 +117,3 @@ // Generated by CoffeeScript 1.6.3

Helpers.autowireArguments = function(method, args, container) {
var dots, factory, parameter, previousDots, result, service, _i, _len, _ref;
var dots, factory, hints, i, originalArgs, parameter, previousDots, result, service, _i, _len, _ref;
if (args == null) {

@@ -127,11 +127,13 @@ args = [];

args = Helpers.clone(args);
if (args.length === 0) {
args = Helpers.getHintArguments(method);
if (args === null) {
args = [];
}
originalArgs = args;
hints = Helpers.getHintArguments(method);
if (hints !== null) {
args = Helpers.clone(hints);
}
_ref = Helpers.getArguments(method);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
parameter = _ref[_i];
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
parameter = _ref[i];
if (args[0] === '...' && hints !== null) {
args[0] = originalArgs[i];
}
if (typeof args[0] !== 'undefined' && args[0] === '...') {

@@ -138,0 +140,0 @@ dots = true;

{
"name": "dependency-injection",
"description": "Dependency injection with configuration and autowire for node js and browser",
"version": "2.0.0",
"version": "2.0.1",
"author": {

@@ -6,0 +6,0 @@ "name": "David Kudera",

@@ -398,2 +398,5 @@ [![NPM version](https://badge.fury.io/js/dependency-injection.png)](http://badge.fury.io/js/dependency-injection)

* 2.0.1
+ Injecting by arguments and hints was not working
* 2.0.0

@@ -400,0 +403,0 @@ + Removed autowiring into `inject` methods (BC break!)

@@ -116,2 +116,12 @@ // Generated by CoffeeScript 1.6.3

});
it('should inject services to another service with argument and hint', function() {
var fn;
fn = function(something, sameThing) {
return {
'@di:inject': ['...', '@data']
};
};
di.addService('data', ['one']).setInstantiate(false);
return expect(Helpers.autowireArguments(fn, ['@data'], di)).to.be.eql([['one'], ['one']]);
});
it('should inject services replaced with dots in the end', function() {

@@ -118,0 +128,0 @@ var fn;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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