@stone-js/service-container 0.0.43 → 0.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
4
|
[](https://www.npmjs.com/package/@stone-js/service-container)
|
|
5
5
|
[](https://www.npmjs.com/package/@stone-js/service-container)
|
|
6
|
-

|
|
7
7
|
[](https://github.com/stonemjs/service-container/actions/workflows/release.yml)
|
|
8
8
|
[](https://conventionalcommits.org)
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -218,7 +218,7 @@ declare class Container extends Proxiable {
|
|
|
218
218
|
* @returns The resolved value.
|
|
219
219
|
* @throws ContainerError if the key cannot be resolved.
|
|
220
220
|
*/
|
|
221
|
-
make<V extends BindingValue>(key: BindingKey): V
|
|
221
|
+
make<V extends BindingValue>(key: BindingKey): V;
|
|
222
222
|
/**
|
|
223
223
|
* Resolve a value from the container by its key, binding it if necessary.
|
|
224
224
|
*
|
|
@@ -226,14 +226,14 @@ declare class Container extends Proxiable {
|
|
|
226
226
|
* @param singleton - Whether to bind as a singleton if not already bound.
|
|
227
227
|
* @returns The resolved value.
|
|
228
228
|
*/
|
|
229
|
-
resolve<V extends BindingValue>(key: BindingKey, singleton?: boolean): V
|
|
229
|
+
resolve<V extends BindingValue>(key: BindingKey, singleton?: boolean): V;
|
|
230
230
|
/**
|
|
231
231
|
* Resolve a value from the container by its key and return it in a factory function.
|
|
232
232
|
*
|
|
233
233
|
* @param key - The key to resolve.
|
|
234
234
|
* @returns A factory function that returns the resolved value.
|
|
235
235
|
*/
|
|
236
|
-
factory<V extends BindingValue>(key: BindingKey): () => V
|
|
236
|
+
factory<V extends BindingValue>(key: BindingKey): () => V;
|
|
237
237
|
/**
|
|
238
238
|
* Check if a value is already bound in the container by its key.
|
|
239
239
|
*
|
package/dist/index.js
CHANGED
|
@@ -454,8 +454,9 @@ class Container extends Proxiable {
|
|
|
454
454
|
}
|
|
455
455
|
this.resolvingKeys.add(key);
|
|
456
456
|
try {
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
const binding = this.bindings.get(key);
|
|
458
|
+
if (binding !== undefined) {
|
|
459
|
+
return binding.resolve(this);
|
|
459
460
|
}
|
|
460
461
|
}
|
|
461
462
|
finally {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stone-js/service-container",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.44",
|
|
4
|
+
"description": "Javascript/Typescript IoC Service Container with proxy resolver and destructuring injection",
|
|
5
5
|
"author": "Mr. Stone <evensstone@gmail.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|