Comparing version 0.7.1 to 0.7.2
;(function(undefined) { | ||
'use strict'; | ||
/** | ||
* BottleJS v0.7.1 - 2014-12-06 | ||
* BottleJS v0.7.2 - 2014-12-26 | ||
* A powerful, extensible dependency injection micro container | ||
@@ -100,2 +100,12 @@ * | ||
/** | ||
* Get a service stored under a nested key | ||
* | ||
* @param String fullname | ||
* @return Service | ||
*/ | ||
var getNestedService = function getNestedService(fullname) { | ||
return fullname.split('.').reduce(getNested, this); | ||
}; | ||
/** | ||
* A helper function for pushing middleware and decorators onto their stacks. | ||
@@ -175,11 +185,2 @@ * | ||
/** | ||
* Get a service stored under a nested key | ||
* | ||
* @param String fullname | ||
* @return Service | ||
*/ | ||
var getNestedService = function getNestedService(fullname) { | ||
return fullname.split('.').reduce(getNested, this); | ||
}; | ||
@@ -455,7 +456,9 @@ /** | ||
var service = function service(name, Service) { | ||
var deps = arguments.length > 2 ? slice.call(arguments, 1) : null; | ||
var deps = arguments.length > 2 ? slice.call(arguments, 2) : null; | ||
var bottle = this; | ||
return factory.call(this, name, function GenericFactory() { | ||
if (deps) { | ||
Service = Service.bind.apply(Service, deps.map(getNested.bind(bottle, bottle.container))); | ||
deps = deps.map(getNestedService, bottle.container); | ||
deps.unshift(Service); | ||
Service = Service.bind.apply(Service, deps); | ||
} | ||
@@ -462,0 +465,0 @@ return new Service(); |
{ | ||
"name": "bottlejs", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "A powerful, extensible dependency injection micro container", | ||
@@ -5,0 +5,0 @@ "main": "dist/bottle.js", |
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
31206
547