plain-ioc 0.1.3 → 1.0.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 Sality
3
+ Copyright (c) 2025 mvcbox
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,2 +1,270 @@
1
+ [![npm version](https://badge.fury.io/js/plain-ioc.svg?flush_cache=v1_0_0)](https://badge.fury.io/js/plain-ioc)
2
+
1
3
  # plain-ioc
2
- Plain inversion of control container
4
+
5
+ A small, dependency-free **Inversion of Control (IoC) / Dependency Injection** container for Node.js and TypeScript.
6
+
7
+ **Highlights**
8
+
9
+ - **Synchronous factories only** (factories cannot return a `Promise`)
10
+ - **Transient** and **singleton** bindings
11
+ - Optional **circular dependency detection** (useful in development)
12
+ - Tiny API surface
13
+
14
+ ---
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install plain-ioc
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Core concepts
25
+
26
+ ### Dependency keys
27
+
28
+ A *dependency key* is used to register and later resolve a dependency.
29
+
30
+ In TypeScript, the key type is:
31
+
32
+ ```ts
33
+ type DependencyKey = string | symbol | object;
34
+ ```
35
+
36
+ Recommended key styles:
37
+
38
+ - **`symbol`** keys for interfaces or abstract concepts (prevents accidental collisions)
39
+ - **class constructors** as keys for concrete classes
40
+ - **`string`** keys for quick scripts or small apps
41
+
42
+ > Tip: Using `Symbol('Name')` makes debugging easier.
43
+
44
+ ### Factories
45
+
46
+ A *factory* creates the dependency instance.
47
+
48
+ ```ts
49
+ interface DependencyFactory<T> {
50
+ (container: Container): T; // must not return a Promise
51
+ }
52
+ ```
53
+
54
+ Factories receive the `Container`, so they can resolve other dependencies.
55
+
56
+ ---
57
+
58
+ ## Usage
59
+
60
+ ### Create a container
61
+
62
+ ```ts
63
+ import { Container } from "plain-ioc";
64
+
65
+ const container = new Container();
66
+ ```
67
+
68
+ ### Bind and resolve (transient)
69
+
70
+ `bind()` registers a factory that runs **every time** you resolve the key.
71
+
72
+ ```ts
73
+ import { Container } from "plain-ioc";
74
+
75
+ const c = new Container();
76
+
77
+ c.bind("now", () => Date.now());
78
+
79
+ const a = c.resolve<number>("now");
80
+ const b = c.resolve<number>("now");
81
+ // a !== b (very likely)
82
+ ```
83
+
84
+ ### Bind and resolve (singleton)
85
+
86
+ `bindSingleton()` registers a factory that runs **once**. The created instance is cached and returned for subsequent resolves.
87
+
88
+ ```ts
89
+ import { Container } from "plain-ioc";
90
+
91
+ class Logger {
92
+ log(message: string) {
93
+ console.log(message);
94
+ }
95
+ }
96
+
97
+ const c = new Container();
98
+
99
+ c.bindSingleton(Logger, () => new Logger());
100
+
101
+ const l1 = c.resolve<Logger>(Logger);
102
+ const l2 = c.resolve<Logger>(Logger);
103
+ // l1 === l2
104
+ ```
105
+
106
+ ### Using symbols (recommended for interfaces)
107
+
108
+ ```ts
109
+ import { Container } from "plain-ioc";
110
+
111
+ interface Config {
112
+ baseUrl: string;
113
+ }
114
+
115
+ const TOKENS = {
116
+ Config: Symbol("Config"),
117
+ } as const;
118
+
119
+ const c = new Container();
120
+
121
+ c.bindSingleton<Config>(TOKENS.Config, () => ({ baseUrl: "https://api.example.com" }));
122
+
123
+ const cfg = c.resolve<Config>(TOKENS.Config);
124
+ ```
125
+
126
+ ### Wiring dependencies together
127
+
128
+ ```ts
129
+ import { Container } from "plain-ioc";
130
+
131
+ const TOKENS = {
132
+ BaseUrl: Symbol("BaseUrl"),
133
+ } as const;
134
+
135
+ class ApiClient {
136
+ constructor(public readonly baseUrl: string) {}
137
+ }
138
+
139
+ const c = new Container();
140
+
141
+ c.bindSingleton<string>(TOKENS.BaseUrl, () => "https://api.example.com");
142
+ c.bindSingleton(ApiClient, (c) => new ApiClient(c.resolve(TOKENS.BaseUrl)));
143
+
144
+ const api = c.resolve<ApiClient>(ApiClient);
145
+ console.log(api.baseUrl);
146
+ ```
147
+
148
+ ### Check if a key is bound
149
+
150
+ ```ts
151
+ import { Container } from "plain-ioc";
152
+
153
+ const c = new Container();
154
+
155
+ c.isBound("service"); // false
156
+ c.bind("service", () => ({ ok: true }));
157
+ c.isBound("service"); // true
158
+ ```
159
+
160
+ ### Unbind
161
+
162
+ `unbind()` removes the factory. If the binding was a singleton, its cached instance is removed as well.
163
+
164
+ ```ts
165
+ import { Container } from "plain-ioc";
166
+
167
+ const c = new Container();
168
+
169
+ c.bindSingleton("app", () => ({ name: "demo" }));
170
+
171
+ c.unbind("app");
172
+ // c.resolve("app") will now throw
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Circular dependency detection
178
+
179
+ By default, circular dependency detection is **off**.
180
+
181
+ Enable it when creating the container:
182
+
183
+ ```ts
184
+ import { Container } from "plain-ioc";
185
+
186
+ const c = new Container({ circularDependencyDetect: true });
187
+ ```
188
+
189
+ When enabled, `resolve()` tracks a stack of keys being resolved. If the same key appears twice in the stack, a `CircularDependencyError` is thrown with a message that includes the dependency stack.
190
+
191
+ > Recommendation: Keep this enabled in development/test, and turn it off in production for minimal overhead.
192
+
193
+ ---
194
+
195
+ ## API reference
196
+
197
+ ### `new Container(options?)`
198
+
199
+ Creates a container.
200
+
201
+ - `options.circularDependencyDetect?: boolean` — default `false`
202
+
203
+ ### `container.bind<T>(key, factory)`
204
+
205
+ Registers a **transient** factory.
206
+
207
+ - Throws `FactoryAlreadyBoundError` if the key is already registered.
208
+
209
+ ### `container.bindSingleton<T>(key, factory)`
210
+
211
+ Registers a **singleton** factory.
212
+
213
+ - Throws `FactoryAlreadyBoundError` if the key is already registered.
214
+
215
+ ### `container.resolve<T>(key): T`
216
+
217
+ Resolves an instance.
218
+
219
+ - Throws `FactoryNotBoundError` if the key is not registered.
220
+ - Throws `CircularDependencyError` when circular dependency detection is enabled and a cycle is detected.
221
+
222
+ ### `container.unbind(key)`
223
+
224
+ Removes a registered factory and clears any cached singleton instance.
225
+
226
+ - Throws `FactoryNotBoundError` if the key is not registered.
227
+
228
+ ### `container.isBound(key): boolean`
229
+
230
+ Returns `true` if a factory is registered for `key`.
231
+
232
+ ---
233
+
234
+ ## Errors
235
+
236
+ All library errors extend the base class `PlainIocError`:
237
+
238
+ - `PlainIocError`
239
+ - `FactoryNotBoundError`
240
+ - `FactoryAlreadyBoundError`
241
+ - `CircularDependencyError`
242
+
243
+ You can catch these specifically:
244
+
245
+ ```ts
246
+ import { Container, FactoryNotBoundError } from "plain-ioc";
247
+
248
+ const c = new Container();
249
+
250
+ try {
251
+ c.resolve("missing");
252
+ } catch (e) {
253
+ if (e instanceof FactoryNotBoundError) {
254
+ console.error("Not registered");
255
+ }
256
+ }
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Notes & limitations
262
+
263
+ - Factories are **synchronous** (the type system rejects `Promise`-returning factories). If you need async initialization, create the instance elsewhere and bind it as a singleton value via a factory like `() => alreadyInitialized`.
264
+ - There is a single container scope (no built-in child containers / scopes).
265
+
266
+ ---
267
+
268
+ ## License
269
+
270
+ MIT
@@ -1,13 +1,19 @@
1
- import { Dependency } from './Dependency';
2
- import { DependencyKey } from './DependencyKey';
3
- import { DependencyFacroty } from './DependencyFacroty';
1
+ import type { Dependency } from './Dependency';
2
+ import type { DependencyKey } from './DependencyKey';
3
+ import type { ContainerOptions } from './ContainerOptions';
4
+ import type { DependencyFactory } from './DependencyFactory';
4
5
  export declare class Container {
5
- dependencies: Map<DependencyKey, Dependency<any>>;
6
- initInstances: Map<DependencyKey, any>;
7
- bind<T>(key: DependencyKey, factory: DependencyFacroty<T>): void;
6
+ protected readonly circularDependencyDetect: boolean;
7
+ protected readonly circularDependencyStack: DependencyKey[];
8
+ protected readonly initializedInstances: Map<DependencyKey, unknown>;
9
+ protected readonly dependencies: Map<DependencyKey, Dependency<unknown>>;
10
+ constructor(options?: ContainerOptions);
11
+ protected circularDependencyStackPush(key: DependencyKey): void;
12
+ protected circularDependencyStackPop(): void;
13
+ protected keyToString(key: DependencyKey): string;
14
+ bind<T>(key: DependencyKey, factory: DependencyFactory<T>): void;
8
15
  unbind(key: DependencyKey): void;
9
- bindSingleton<T>(key: DependencyKey, factory: DependencyFacroty<T>): void;
16
+ bindSingleton<T>(key: DependencyKey, factory: DependencyFactory<T>): void;
10
17
  isBound(key: DependencyKey): boolean;
11
18
  resolve<T>(key: DependencyKey): T;
12
- keyToString(key: DependencyKey): string;
13
19
  }
package/dist/Container.js CHANGED
@@ -1,14 +1,53 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Container = void 0;
3
4
  const errors_1 = require("./errors");
4
5
  class Container {
5
- constructor() {
6
+ constructor(options) {
7
+ var _a;
8
+ this.circularDependencyStack = [];
9
+ this.initializedInstances = new Map();
6
10
  this.dependencies = new Map();
7
- this.initInstances = new Map();
11
+ this.circularDependencyDetect = (_a = options === null || options === void 0 ? void 0 : options.circularDependencyDetect) !== null && _a !== void 0 ? _a : false;
12
+ }
13
+ circularDependencyStackPush(key) {
14
+ if (!this.circularDependencyDetect) {
15
+ return;
16
+ }
17
+ const detected = this.circularDependencyStack.findIndex(item => item === key) !== -1;
18
+ this.circularDependencyStack.push(key);
19
+ if (detected) {
20
+ let errorMessage = 'Circular dependency detected\n\n';
21
+ errorMessage += '>>>>>>> Circular Dependency Stack <<<<<<<\n';
22
+ errorMessage += this.circularDependencyStack.map((item, index) => {
23
+ return `>>> [${index}]: ${this.keyToString(item)}\n`;
24
+ }).join('');
25
+ throw new errors_1.CircularDependencyError(errorMessage);
26
+ }
27
+ }
28
+ circularDependencyStackPop() {
29
+ if (this.circularDependencyDetect) {
30
+ this.circularDependencyStack.pop();
31
+ }
32
+ }
33
+ keyToString(key) {
34
+ const type = typeof key;
35
+ try {
36
+ if (typeof key === 'function') {
37
+ return `"${key.name || '<anonymous>'}" (${type})`;
38
+ }
39
+ if (type === 'object') {
40
+ return `"${Object.prototype.toString.call(key)}" (${type})`;
41
+ }
42
+ return `"${String(key)}" (${type})`;
43
+ }
44
+ catch (_a) {
45
+ return `"<unprintable>" (${type})`;
46
+ }
8
47
  }
9
48
  bind(key, factory) {
10
49
  if (this.dependencies.has(key)) {
11
- throw new errors_1.FactoryAlreadyBoundError(`Factory for '${this.keyToString(key)}' already bound`);
50
+ throw new errors_1.FactoryAlreadyBoundError(`Factory for ${this.keyToString(key)} already bound`);
12
51
  }
13
52
  this.dependencies.set(key, {
14
53
  factory
@@ -16,14 +55,14 @@ class Container {
16
55
  }
17
56
  unbind(key) {
18
57
  if (!this.dependencies.has(key)) {
19
- throw new errors_1.FactoryNotBoundError(`Factory not bound with '${this.keyToString(key)}'`);
58
+ throw new errors_1.FactoryNotBoundError(`Factory not bound with ${this.keyToString(key)}`);
20
59
  }
21
60
  this.dependencies.delete(key);
22
- this.initInstances.delete(key);
61
+ this.initializedInstances.delete(key);
23
62
  }
24
63
  bindSingleton(key, factory) {
25
64
  if (this.dependencies.has(key)) {
26
- throw new errors_1.FactoryAlreadyBoundError(`Factory for '${this.keyToString(key)}' already bound`);
65
+ throw new errors_1.FactoryAlreadyBoundError(`Factory for ${this.keyToString(key)} already bound`);
27
66
  }
28
67
  this.dependencies.set(key, {
29
68
  factory,
@@ -35,24 +74,24 @@ class Container {
35
74
  }
36
75
  resolve(key) {
37
76
  if (!this.dependencies.has(key)) {
38
- throw new errors_1.FactoryNotBoundError(`Factory not bound with '${this.keyToString(key)}'`);
77
+ throw new errors_1.FactoryNotBoundError(`Factory not bound with ${this.keyToString(key)}`);
39
78
  }
40
79
  const dependency = this.dependencies.get(key);
41
- if (dependency.singleton && this.initInstances.has(key)) {
42
- return this.initInstances.get(key);
80
+ if (dependency.singleton && this.initializedInstances.has(key)) {
81
+ return this.initializedInstances.get(key);
43
82
  }
44
- else if (dependency.singleton) {
45
- const instance = dependency.factory(this);
46
- this.initInstances.set(key, instance);
47
- return instance;
83
+ try {
84
+ this.circularDependencyStackPush(key);
85
+ if (dependency.singleton) {
86
+ const instance = dependency.factory(this);
87
+ this.initializedInstances.set(key, instance);
88
+ return instance;
89
+ }
90
+ return dependency.factory(this);
48
91
  }
49
- return dependency.factory(this);
50
- }
51
- keyToString(key) {
52
- if (typeof key === 'function') {
53
- return key.name || '';
92
+ finally {
93
+ this.circularDependencyStackPop();
54
94
  }
55
- return String(key);
56
95
  }
57
96
  }
58
97
  exports.Container = Container;
@@ -0,0 +1,3 @@
1
+ export type ContainerOptions = {
2
+ circularDependencyDetect?: boolean;
3
+ };
@@ -1,5 +1,5 @@
1
- import { DependencyFacroty } from './DependencyFacroty';
1
+ import type { DependencyFactory } from './DependencyFactory';
2
2
  export interface Dependency<T> {
3
- factory: DependencyFacroty<T>;
3
+ factory: DependencyFactory<T>;
4
4
  singleton?: boolean;
5
5
  }
@@ -0,0 +1,6 @@
1
+ import type { Container } from './Container';
2
+ type NotPromise<T> = T extends PromiseLike<any> ? never : T;
3
+ export interface DependencyFactory<T> {
4
+ (container: Container): NotPromise<T>;
5
+ }
6
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- export declare type DependencyKey = string | symbol | object;
1
+ export type DependencyKey = string | symbol | object;
@@ -0,0 +1,3 @@
1
+ import { PlainIocError } from './PlainIocError';
2
+ export declare class CircularDependencyError extends PlainIocError {
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CircularDependencyError = void 0;
4
+ const PlainIocError_1 = require("./PlainIocError");
5
+ class CircularDependencyError extends PlainIocError_1.PlainIocError {
6
+ }
7
+ exports.CircularDependencyError = CircularDependencyError;
@@ -1,2 +1,3 @@
1
- export declare class FactoryAlreadyBoundError extends Error {
1
+ import { PlainIocError } from './PlainIocError';
2
+ export declare class FactoryAlreadyBoundError extends PlainIocError {
2
3
  }
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- class FactoryAlreadyBoundError extends Error {
3
+ exports.FactoryAlreadyBoundError = void 0;
4
+ const PlainIocError_1 = require("./PlainIocError");
5
+ class FactoryAlreadyBoundError extends PlainIocError_1.PlainIocError {
4
6
  }
5
7
  exports.FactoryAlreadyBoundError = FactoryAlreadyBoundError;
@@ -1,2 +1,3 @@
1
- export declare class FactoryNotBoundError extends Error {
1
+ import { PlainIocError } from './PlainIocError';
2
+ export declare class FactoryNotBoundError extends PlainIocError {
2
3
  }
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- class FactoryNotBoundError extends Error {
3
+ exports.FactoryNotBoundError = void 0;
4
+ const PlainIocError_1 = require("./PlainIocError");
5
+ class FactoryNotBoundError extends PlainIocError_1.PlainIocError {
4
6
  }
5
7
  exports.FactoryNotBoundError = FactoryNotBoundError;
@@ -0,0 +1,3 @@
1
+ export declare class PlainIocError extends Error {
2
+ constructor(message?: string);
3
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlainIocError = void 0;
4
+ class PlainIocError extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ this.name = new.target.name;
8
+ if (Error.captureStackTrace) {
9
+ Error.captureStackTrace(this, new.target);
10
+ }
11
+ }
12
+ }
13
+ exports.PlainIocError = PlainIocError;
@@ -1,2 +1,4 @@
1
+ export { PlainIocError } from './PlainIocError';
1
2
  export { FactoryNotBoundError } from './FactoryNotBoundError';
3
+ export { CircularDependencyError } from './CircularDependencyError';
2
4
  export { FactoryAlreadyBoundError } from './FactoryAlreadyBoundError';
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FactoryAlreadyBoundError = exports.CircularDependencyError = exports.FactoryNotBoundError = exports.PlainIocError = void 0;
4
+ var PlainIocError_1 = require("./PlainIocError");
5
+ Object.defineProperty(exports, "PlainIocError", { enumerable: true, get: function () { return PlainIocError_1.PlainIocError; } });
3
6
  var FactoryNotBoundError_1 = require("./FactoryNotBoundError");
4
- exports.FactoryNotBoundError = FactoryNotBoundError_1.FactoryNotBoundError;
7
+ Object.defineProperty(exports, "FactoryNotBoundError", { enumerable: true, get: function () { return FactoryNotBoundError_1.FactoryNotBoundError; } });
8
+ var CircularDependencyError_1 = require("./CircularDependencyError");
9
+ Object.defineProperty(exports, "CircularDependencyError", { enumerable: true, get: function () { return CircularDependencyError_1.CircularDependencyError; } });
5
10
  var FactoryAlreadyBoundError_1 = require("./FactoryAlreadyBoundError");
6
- exports.FactoryAlreadyBoundError = FactoryAlreadyBoundError_1.FactoryAlreadyBoundError;
11
+ Object.defineProperty(exports, "FactoryAlreadyBoundError", { enumerable: true, get: function () { return FactoryAlreadyBoundError_1.FactoryAlreadyBoundError; } });
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './errors';
2
2
  export { Container } from './Container';
3
- export { Dependency } from './Dependency';
4
- export { DependencyKey } from './DependencyKey';
5
- export { DependencyFacroty } from './DependencyFacroty';
3
+ export type { Dependency } from './Dependency';
4
+ export type { DependencyKey } from './DependencyKey';
5
+ export type { DependencyFactory } from './DependencyFactory';
6
+ export type { ContainerOptions } from './ContainerOptions';
package/dist/index.js CHANGED
@@ -1,8 +1,20 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./errors"));
17
+ exports.Container = void 0;
18
+ __exportStar(require("./errors"), exports);
7
19
  var Container_1 = require("./Container");
8
- exports.Container = Container_1.Container;
20
+ Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return Container_1.Container; } });
package/package.json CHANGED
@@ -1,12 +1,36 @@
1
1
  {
2
2
  "name": "plain-ioc",
3
- "version": "0.1.3",
3
+ "version": "1.0.0",
4
4
  "description": "Plain inversion of control container",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "type": "commonjs",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
7
15
  "scripts": {
8
- "build": "node ./node_modules/typescript/bin/tsc",
9
- "test": "echo \"Error: no test specified\" && exit 1"
16
+ "build": "npm run clean && node ./node_modules/.bin/tsc",
17
+ "clean": "node -e \"['./dist'].forEach(item => require('fs').rmSync(item, {recursive:true,force:true}));\"",
18
+ "prepack": "npm run build"
19
+ },
20
+ "engines": {
21
+ "node": ">=6.0.0"
22
+ },
23
+ "devEngines": {
24
+ "runtime": {
25
+ "name": "node",
26
+ "version": ">=18.0.0",
27
+ "onFail": "error"
28
+ },
29
+ "packageManager": {
30
+ "name": "npm",
31
+ "version": ">=8.6.0",
32
+ "onFail": "error"
33
+ }
10
34
  },
11
35
  "repository": {
12
36
  "type": "git",
@@ -24,8 +48,13 @@
24
48
  "url": "https://github.com/mvcbox/node-plain-ioc/issues"
25
49
  },
26
50
  "homepage": "https://github.com/mvcbox/node-plain-ioc#readme",
51
+ "files": [
52
+ "dist",
53
+ "LICENSE",
54
+ "README.md"
55
+ ],
27
56
  "devDependencies": {
28
- "@types/node": "^12.7.2",
29
- "typescript": "^3.5.3"
57
+ "@types/node": "^6.14.13",
58
+ "typescript": "^4.7.2"
30
59
  }
31
60
  }
@@ -1,4 +0,0 @@
1
- import { Container } from './Container';
2
- export interface DependencyFacroty<T> {
3
- (container: Container): T;
4
- }
@@ -1,2 +0,0 @@
1
- export declare class FactoryNotBound extends Error {
2
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- exports.__esModule = true;
16
- var FactoryNotBound = (function (_super) {
17
- __extends(FactoryNotBound, _super);
18
- function FactoryNotBound() {
19
- return _super !== null && _super.apply(this, arguments) || this;
20
- }
21
- return FactoryNotBound;
22
- }(Error));
23
- exports.FactoryNotBound = FactoryNotBound;