first-di 3.1.0 → 3.2.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/dist/classes/di.js +3 -5
- package/package.json +15 -15
package/dist/classes/di.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-params */
|
|
1
2
|
import { AutowiredLifetimes } from "../models/autowired-lifetimes.js";
|
|
2
3
|
export class DI {
|
|
3
4
|
constructor() {
|
|
@@ -7,9 +8,7 @@ export class DI {
|
|
|
7
8
|
this.reset = () => {
|
|
8
9
|
this.makeReset();
|
|
9
10
|
};
|
|
10
|
-
this.resolve = (constructor, options, caller, propertyKey
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
12
|
-
) => this.makeResolve(constructor, options, caller, propertyKey);
|
|
11
|
+
this.resolve = (constructor, options, caller, propertyKey) => this.makeResolve(constructor, options, caller, propertyKey);
|
|
13
12
|
this.singleton = (constructor, options) => this.makeResolve(constructor, { ...options,
|
|
14
13
|
lifeTime: AutowiredLifetimes.Singleton });
|
|
15
14
|
this.instance = (constructor, options) => this.makeResolve(constructor, { ...options,
|
|
@@ -40,7 +39,7 @@ export class DI {
|
|
|
40
39
|
});
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
|
-
// eslint-disable-next-line max-statements
|
|
42
|
+
// eslint-disable-next-line max-statements
|
|
44
43
|
makeResolve(inConstructor, inOptions, caller, propertyKey) {
|
|
45
44
|
let constructor = inConstructor;
|
|
46
45
|
let options = inOptions;
|
|
@@ -91,7 +90,6 @@ export class DI {
|
|
|
91
90
|
options
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
95
93
|
getDiKey(propertyKey) {
|
|
96
94
|
return `$_di_${String(propertyKey)}`; // Think about symbol
|
|
97
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "first-di",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"author": "Eugene Labutin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/LabEG/first-di#readme",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"lint-staged": {
|
|
19
19
|
"./tests/**/*.(ts|tsx|js|jsx)": [
|
|
20
|
-
"eslint --fix
|
|
20
|
+
"eslint --fix"
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"lint": "eslint --fix
|
|
24
|
+
"lint": "eslint --fix ./src/ ./tests/",
|
|
25
25
|
"test": "mocha --reporter spec --require ts-node/register tests/*.test.ts",
|
|
26
26
|
"build": "rm -rf dist/ && tsc --project tsconfig.build.json && node ./dist/index.js",
|
|
27
27
|
"release": "cliff-jumper --name '@labeg/code-style' --package-path '.' --no-skip-changelog --no-skip-tag",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"reflect-metadata": ">=0.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@labeg/code-style": "^
|
|
36
|
-
"@types/chai": "^5.0.
|
|
37
|
-
"@types/mocha": "^10.0.
|
|
38
|
-
"@types/node": "^22.
|
|
39
|
-
"chai": "^5.1.
|
|
40
|
-
"mocha": "^
|
|
35
|
+
"@labeg/code-style": "^5.5.0",
|
|
36
|
+
"@types/chai": "^5.0.1",
|
|
37
|
+
"@types/mocha": "^10.0.10",
|
|
38
|
+
"@types/node": "^22.10.5",
|
|
39
|
+
"chai": "^5.1.2",
|
|
40
|
+
"mocha": "^11.0.1",
|
|
41
41
|
"ts-node": "^10.9.2",
|
|
42
42
|
"reflect-metadata": "^0.2.2",
|
|
43
|
-
"typescript": "^5.
|
|
44
|
-
"@commitlint/cli": "^19.
|
|
45
|
-
"@commitlint/config-conventional": "^19.
|
|
46
|
-
"husky": "^9.1.
|
|
47
|
-
"lint-staged": "^15.
|
|
48
|
-
"@favware/cliff-jumper": "^
|
|
43
|
+
"typescript": "^5.7.2",
|
|
44
|
+
"@commitlint/cli": "^19.6.1",
|
|
45
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
46
|
+
"husky": "^9.1.7",
|
|
47
|
+
"lint-staged": "^15.3.0",
|
|
48
|
+
"@favware/cliff-jumper": "^5.0.0"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"dependency injection",
|