@monkin/di 0.1.13 → 0.1.15

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
@@ -4,7 +4,7 @@
4
4
  [![NPM version](https://img.shields.io/npm/v/@monkin/di.svg)](https://www.npmjs.com/package/@monkin/di)
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
 
7
- `@monkin/di` is a lightweight (461 bytes), type-safe dependency injection container for TypeScript. It leverages TypeScript's advanced type system to provide a fluent API for service registration and resolution with full type safety and autocompletion.
7
+ `@monkin/di` is a lightweight (454 bytes), type-safe dependency injection container for TypeScript. It leverages TypeScript's advanced type system to provide a fluent API for service registration and resolution with full type safety and autocompletion.
8
8
 
9
9
  ## Table of Contents
10
10
 
@@ -30,7 +30,7 @@
30
30
  - **Fluent API**: Chainable service registration makes it easy to compose your container.
31
31
  - **Container Composition**: Merge multiple containers together to share dependencies across different parts of your application.
32
32
  - **Lazy**: Services are instantiated only on demand (when first accessed) and reused for subsequent accesses.
33
- - **Zero Runtime Dependencies**: Extremely lightweight (461 bytes minified / 318 bytes gzipped).
33
+ - **Zero Runtime Dependencies**: Extremely lightweight (454 bytes minified / 309 bytes gzipped).
34
34
 
35
35
  ## Installation
36
36
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- class e{inject(...e){return e.reduce((e,r)=>{let t,n=r.prototype,i=(0,n.getServiceName)();if(e[i])throw Error((e.hasOwnProperty(i)?"Duplicat":"Reserv")+"ed service name: "+i);return e[i]=new Proxy(Object.create(n),{get:(n,o)=>{t||=e[i]=new r(e);let a=t[o];return"function"==typeof a?a.bind(t):a}}),e},this)}injectContainer(e){for(let r in e)if(r in this)throw Error("Containers have duplicated keys: "+r);return Object.assign(this,e)}}export{e as DiContainer};
1
+ class e{inject(...t){return t.reduce((t,r)=>{let i,n=r.prototype,o=(0,n.getServiceName)();if(t[o])throw Error((o in e.prototype?"Reserv":"Duplicat")+"ed service name: "+o);return t[o]=new Proxy(Object.create(n),{get:(e,n)=>{i||=t[o]=new r(t);let a=i[n];return"f"==(typeof a)[0]?a.bind(i):a}}),t},this)}injectContainer(e){for(let t in e)if(this[t])throw Error("Containers have duplicated keys: "+t);return Object.assign(this,e)}}export{e as DiContainer};
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Di={})}(this,function(e){"use strict";e.DiContainer=class{inject(...e){return e.reduce((e,t)=>{let r,i=t.prototype,n=(0,i.getServiceName)();if(e[n])throw Error((e.hasOwnProperty(n)?"Duplicat":"Reserv")+"ed service name: "+n);return e[n]=new Proxy(Object.create(i),{get:(i,o)=>{r||=e[n]=new t(e);let s=r[o];return"function"==typeof s?s.bind(r):s}}),e},this)}injectContainer(e){for(let t in e)if(t in this)throw Error("Containers have duplicated keys: "+t);return Object.assign(this,e)}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ !function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Di={})}(this,function(e){"use strict";class t{inject(...e){return e.reduce((e,r)=>{let i,o=r.prototype,n=(0,o.getServiceName)();if(e[n])throw Error((n in t.prototype?"Reserv":"Duplicat")+"ed service name: "+n);return e[n]=new Proxy(Object.create(o),{get:(t,o)=>{i||=e[n]=new r(e);let s=i[o];return"f"==(typeof s)[0]?s.bind(i):s}}),e},this)}injectContainer(e){for(let t in e)if(this[t])throw Error("Containers have duplicated keys: "+t);return Object.assign(this,e)}}e.DiContainer=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkin/di",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Small type-safe dependency injection lib",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/dist/index.js.gz DELETED
File without changes