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.3.1 to 2.3.2

test/data/Mail.coffee

9

lib/DI.js

@@ -48,3 +48,3 @@ // Generated by CoffeeScript 1.7.1

DI.prototype.addService = function(name, service, args) {
var originalService;
var arg, i, originalService, _i, _len;
if (args == null) {

@@ -68,2 +68,6 @@ args = [];

}
for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
arg = args[i];
args[i] = this.tryCallArgument(arg);
}
this.services[name] = new Service(this, name, service, args);

@@ -93,2 +97,5 @@ this.services[name].setInstantiate(this.instantiate);

}
if (this.config !== null && (match = arg.match(/^%([a-zA-Z.-_]+)%$/))) {
return this.getParameter(match[1]);
}
if (!arg.match(/^(factory\:)?[@$]/)) {

@@ -95,0 +102,0 @@ return arg;

2

package.json
{
"name": "dependency-injection",
"description": "Dependency injection with configuration and autowire for node js and browser",
"version": "2.3.1",
"version": "2.3.2",
"author": {

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

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

* 2.3.1
* 2.3.1 - 2.3.2
+ Fixed bug with passing list of parameters in method calls [https://github.com/sakren/node-dependency-injection/issues/7](#7)

@@ -525,0 +525,0 @@

// Generated by CoffeeScript 1.7.1
(function() {
var Configuration, DI, DIFactory, Database, Http, di, dir, expect, factory, path;
var Configuration, DI, DIFactory, Database, Http, Mail, di, dir, expect, factory, path;

@@ -19,2 +19,4 @@ expect = require('chai').expect;

Mail = require('../../data/Mail');
dir = path.resolve(__dirname + '/../../data');

@@ -48,3 +50,3 @@

});
return it('should create database service with list of parameters', function() {
it('should create database service from factory with list of parameters', function() {
var db;

@@ -62,2 +64,16 @@ factory = new DIFactory(dir + '/database.json');

});
return it('should create service with list of parameters', function() {
var mail;
factory = new DIFactory(dir + '/mail.json');
di = factory.create();
mail = di.get('mail');
expect(mail).to.be.an["instanceof"](Mail);
return expect(mail.setup).to.be.eql({
type: 'SMTP',
auth: {
user: 'root',
pass: 'toor'
}
});
});
});

@@ -64,0 +80,0 @@ describe('#parameters', function() {

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