Comparing version 0.0.4 to 0.1.0
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -9,5 +9,10 @@ var Module = require('./module'); | ||
parent = parent || { | ||
get: function(name) { | ||
get: function(name, strict) { | ||
currentlyResolving.push(name); | ||
throw error('No provider for "' + name + '"!'); | ||
if (strict === false) { | ||
return null; | ||
} else { | ||
throw error('No provider for "' + name + '"!'); | ||
} | ||
} | ||
@@ -28,3 +33,11 @@ }; | ||
var get = function(name) { | ||
/** | ||
* Return a named service. | ||
* | ||
* @param {String} name | ||
* @param {Boolean} [strict=true] if false, resolve missing services to null | ||
* | ||
* @return {Object} | ||
*/ | ||
var get = function(name, strict) { | ||
if (!providers[name] && name.indexOf('.') !== -1) { | ||
@@ -58,3 +71,3 @@ var parts = name.split('.'); | ||
return parent.get(name); | ||
return parent.get(name, strict); | ||
}; | ||
@@ -61,0 +74,0 @@ |
@@ -0,0 +0,0 @@ var Module = function() { |
{ | ||
"name": "didi", | ||
"version": "0.0.4", | ||
"version": "0.1.0", | ||
"description": "Dependency Injection for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -0,0 +0,0 @@ # Dependency Injection for JavaScript |
Sorry, the diff of this file is not supported yet
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
246
15872