@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 CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm](https://img.shields.io/npm/l/@stone-js/service-container)](https://opensource.org/licenses/Apache-2.0)
4
4
  [![npm](https://img.shields.io/npm/v/@stone-js/service-container)](https://www.npmjs.com/package/@stone-js/service-container)
5
5
  [![npm](https://img.shields.io/npm/dm/@stone-js/service-container)](https://www.npmjs.com/package/@stone-js/service-container)
6
- ![Maintenance](https://img.shields.io/maintenance/yes/2024)
6
+ ![Maintenance](https://img.shields.io/maintenance/yes/2025)
7
7
  [![Publish Package to npmjs](https://github.com/stonemjs/service-container/actions/workflows/release.yml/badge.svg)](https://github.com/stonemjs/service-container/actions/workflows/release.yml)
8
8
  [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](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 | undefined;
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 | undefined;
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 | undefined;
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
- if (this.bindings.has(key)) {
458
- return this.bindings.get(key)?.resolve(this);
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.43",
4
- "description": "Vanilla Javascript IoC Service Container with proposal decorator, proxy resolver and destructuring injection",
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": {