Comparing version 5.0.0 to 5.1.0
{ | ||
"name": "incarnate", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Dependency Injection (DI) with Lifecycle features for JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.jsx", |
@@ -50,2 +50,8 @@ /** | ||
strict; | ||
/** | ||
* Always call the `factory` when calling `getPath`, even if there is an existing value. | ||
* @type {boolean} | ||
* */ | ||
noCache; | ||
} |
@@ -6,2 +6,11 @@ import HashMatrix from './HashMatrix'; | ||
const STANDARD_DEPENDENCY_NAMES = { | ||
GLOBAL: 'GLOBAL' | ||
}; | ||
const STANDARD_DEPENDENCIES = { | ||
[STANDARD_DEPENDENCY_NAMES.GLOBAL]: { | ||
factory: () => window || global | ||
} | ||
}; | ||
/** | ||
@@ -13,2 +22,9 @@ * Manage the lifecycle of application dependencies. | ||
static DEFAULT_NAME = 'Incarnate'; | ||
/** | ||
* The names of the dependencies supplied with a standard instance of `Incarnate`. | ||
* @type {Object.<string>} | ||
* */ | ||
static STANDARD_DEPENDENCY_NAMES = STANDARD_DEPENDENCY_NAMES; | ||
static ERRORS = { | ||
@@ -38,9 +54,10 @@ UNSATISFIED_SHARED_DEPENDENCY: 'UNSATISFIED_SHARED_DEPENDENCY' | ||
if (!(this.subMap instanceof Object)) { | ||
this.subMap = {}; | ||
} | ||
if (!(this.hashMatrix instanceof Object)) { | ||
this.hashMatrix = {}; | ||
} | ||
this.subMap = { | ||
...STANDARD_DEPENDENCIES, | ||
...this.subMap | ||
}; | ||
} | ||
@@ -47,0 +64,0 @@ |
@@ -78,2 +78,8 @@ import DependencyDeclaration from './DependencyDeclaration'; | ||
/** | ||
* Always call the `factory` when calling `getPath`, even if there is an existing value. | ||
* @type {boolean} | ||
* */ | ||
noCache; | ||
/** | ||
* @param {DependencyDeclaration} dependencyDeclaration The `DependencyDeclaration` to be resolved. | ||
@@ -198,3 +204,3 @@ * */ | ||
if (typeof directValue === 'undefined') { | ||
if (typeof directValue === 'undefined' || this.noCache) { | ||
const resolvedDirectValue = this.resolve(); | ||
@@ -201,0 +207,0 @@ |
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
3951109
132763