awilix
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -269,7 +269,7 @@ const loadModules = require('./loadModules') | ||
case Lifetime.TRANSIENT: | ||
// Transient lifetime means resolve every time. | ||
// Transient lifetime means resolve every time. | ||
resolved = registration.resolve(container) | ||
break | ||
case Lifetime.SINGLETON: | ||
// Singleton lifetime means cache at all times, regardless of scope. | ||
// Singleton lifetime means cache at all times, regardless of scope. | ||
cached = root.cache[name] | ||
@@ -284,8 +284,8 @@ if (cached === undefined) { | ||
case Lifetime.SCOPED: | ||
// Scoped lifetime means that the container | ||
// that resolves the registration also caches it. | ||
// When a registration is not found, we travel up | ||
// the family tree until we find one that is cached. | ||
// Scoped lifetime means that the container | ||
// that resolves the registration also caches it. | ||
// When a registration is not found, we travel up | ||
// the family tree until we find one that is cached. | ||
// Note: The first element in the family tree is this container. | ||
// Note: The first element in the family tree is this container. | ||
for (const c of familyTree) { | ||
@@ -300,3 +300,3 @@ cached = c.cache[name] | ||
// If we still have not found one, we need to resolve and cache it. | ||
// If we still have not found one, we need to resolve and cache it. | ||
if (cached === undefined) { | ||
@@ -303,0 +303,0 @@ resolved = registration.resolve(container) |
@@ -41,3 +41,3 @@ const glob = require('glob') | ||
/** | ||
* Returns a promise for a list of {name, path} pairs, | ||
* Returns a list of {name, path} pairs, | ||
* where the name is the module name, and path is the actual | ||
@@ -53,4 +53,4 @@ * full path to the module. | ||
* | ||
* @return {Promise<[{name, path}]>} | ||
* A promise for the module names and paths. | ||
* @return {[{name, path}]} | ||
* An array of objects with the module names and paths. | ||
*/ | ||
@@ -57,0 +57,0 @@ module.exports = function listModules (globPatterns, opts) { |
@@ -46,3 +46,3 @@ const Lifetime = require('./Lifetime') | ||
/** | ||
* Creats a simple value registration where the given value will always be resolved. | ||
* Creates a simple value registration where the given value will always be resolved. | ||
* | ||
@@ -72,3 +72,3 @@ * @param {string} name | ||
/** | ||
* Creats a factory registration, where the given factory function | ||
* Creates a factory registration, where the given factory function | ||
* will be invoked with `new` when requested. | ||
@@ -75,0 +75,0 @@ * |
{ | ||
"name": "awilix", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "Simple dependency injection container + helper utilities to facilitate wiring of modules", | ||
"main": "lib/awilix.js", | ||
"typings": "index.d.ts", | ||
"engines": { | ||
@@ -10,8 +11,8 @@ "node": ">=6.0.0" | ||
"scripts": { | ||
"test": "mocha test/**/*.js --require test/index.js", | ||
"test": "tsc && mocha test/**/*.js --require test/index.js", | ||
"test-watch": "npm run test -- --watch --reporter nyan", | ||
"lint": "esw lib/ test/", | ||
"lint-watch": "npm run lint -- --watch", | ||
"cover": "istanbul cover -x \"**example/**\" ./node_modules/mocha/bin/_mocha -- test/**/*.js --require test/index.js", | ||
"coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- test/**/*.js --require test/index.js && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", | ||
"cover": "tsc && istanbul cover -x \"**example/**\" ./node_modules/mocha/bin/_mocha -- test/**/*.js --require test/index.js", | ||
"coveralls": "tsc && istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- test/**/*.js --require test/index.js && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", | ||
"do-publish": "npm run lint && npm run cover && npm publish" | ||
@@ -37,2 +38,4 @@ }, | ||
"devDependencies": { | ||
"@types/chai": "^3.4.35", | ||
"@types/node": "^7.0.8", | ||
"chai": "^3.5.0", | ||
@@ -47,4 +50,6 @@ "coveralls": "^2.11.16", | ||
"mocha": "^3.2.0", | ||
"mocha-typescript": "^1.0.23", | ||
"sinon": "^1.17.7", | ||
"sinon-chai": "^2.8.0" | ||
"sinon-chai": "^2.8.0", | ||
"typescript": "^2.2.1" | ||
}, | ||
@@ -51,0 +56,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
294171
44
1485
15