first-di 3.1.0 → 3.2.1
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 +17 -18
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.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"author": "Eugene Labutin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/LabEG/first-di#readme",
|
|
@@ -17,14 +17,16 @@
|
|
|
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
|
|
25
|
-
"test": "
|
|
24
|
+
"lint": "eslint --fix ./src/ ./tests/",
|
|
25
|
+
"test": "node --import ./ts-loader.js --test --test-reporter=spec --test-reporter-destination=stdout \"tests/**/*.spec.ts\"",
|
|
26
|
+
"test-watch": "node --watch --import ./ts-loader.js --test --test-reporter=spec --test-reporter-destination=stdout \"tests/**/*.spec.ts\"",
|
|
27
|
+
"coverage": "node --import ./ts-loader.js --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=coverage/lcov.info \"tests/**/*.spec.ts\"",
|
|
26
28
|
"build": "rm -rf dist/ && tsc --project tsconfig.build.json && node ./dist/index.js",
|
|
27
|
-
"release": "cliff-jumper --name '
|
|
29
|
+
"release": "cliff-jumper --name 'first-di' --package-path '.' --no-skip-changelog --no-skip-tag",
|
|
28
30
|
"prepublishOnly": "npm run lint && npm run build && npm run test",
|
|
29
31
|
"prepare": "husky install"
|
|
30
32
|
},
|
|
@@ -32,20 +34,17 @@
|
|
|
32
34
|
"reflect-metadata": ">=0.1.0"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
|
-
"@labeg/code-style": "^
|
|
36
|
-
"@
|
|
37
|
-
"@types/
|
|
38
|
-
"
|
|
39
|
-
"chai": "^5.1.1",
|
|
40
|
-
"mocha": "^10.7.3",
|
|
41
|
-
"ts-node": "^10.9.2",
|
|
37
|
+
"@labeg/code-style": "^5.5.0",
|
|
38
|
+
"@swc-node/register": "^1.10.9",
|
|
39
|
+
"@types/chai": "^5.0.1",
|
|
40
|
+
"chai": "^5.1.2",
|
|
42
41
|
"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": "^
|
|
42
|
+
"typescript": "^5.7.2",
|
|
43
|
+
"@commitlint/cli": "^19.6.1",
|
|
44
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
45
|
+
"husky": "^9.1.7",
|
|
46
|
+
"lint-staged": "^15.3.0",
|
|
47
|
+
"@favware/cliff-jumper": "^5.0.0"
|
|
49
48
|
},
|
|
50
49
|
"keywords": [
|
|
51
50
|
"dependency injection",
|