@hg-ts/async-context 0.3.4 → 0.4.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/async-context.not-found.exception.js +2 -6
- package/dist/async-context.not-found.exception.js.map +1 -1
- package/dist/async-context.provider.js +7 -11
- package/dist/async-context.provider.js.map +1 -1
- package/dist/async-context.test.d.ts.map +1 -1
- package/dist/async-context.test.js +75 -78
- package/dist/async-context.test.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/tsconfig.json +1 -1
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AsyncContextNotFoundException = void 0;
|
|
4
|
-
const exception_1 = require("@hg-ts/exception");
|
|
5
|
-
class AsyncContextNotFoundException extends exception_1.BaseException {
|
|
1
|
+
import { BaseException } from '@hg-ts/exception';
|
|
2
|
+
export class AsyncContextNotFoundException extends BaseException {
|
|
6
3
|
constructor() {
|
|
7
4
|
super('Async context not provided');
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
exports.AsyncContextNotFoundException = AsyncContextNotFoundException;
|
|
11
7
|
//# sourceMappingURL=async-context.not-found.exception.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-context.not-found.exception.js","sourceRoot":"","sources":["../src/async-context.not-found.exception.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"async-context.not-found.exception.js","sourceRoot":"","sources":["../src/async-context.not-found.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,OAAO,6BAA8B,SAAQ,aAAa;IAC/D;QACC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACrC,CAAC;CACD"}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const async_context_not_found_exception_1 = require("./async-context.not-found.exception");
|
|
7
|
-
class AsyncContextProvider {
|
|
8
|
-
storage = new node_async_hooks_1.AsyncLocalStorage();
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { Observable, } from 'rxjs';
|
|
3
|
+
import { AsyncContextNotFoundException } from './async-context.not-found.exception.js';
|
|
4
|
+
export class AsyncContextProvider {
|
|
5
|
+
storage = new AsyncLocalStorage();
|
|
9
6
|
get() {
|
|
10
7
|
return this.storage.getStore() ?? null;
|
|
11
8
|
}
|
|
12
9
|
getOrFail() {
|
|
13
10
|
const context = this.get();
|
|
14
11
|
if (typeof context === 'undefined' || context === null) {
|
|
15
|
-
throw new
|
|
12
|
+
throw new AsyncContextNotFoundException();
|
|
16
13
|
}
|
|
17
14
|
return context;
|
|
18
15
|
}
|
|
@@ -32,7 +29,7 @@ class AsyncContextProvider {
|
|
|
32
29
|
return this.createOperator(next => this.storage.exit(next));
|
|
33
30
|
}
|
|
34
31
|
createOperator(onNext) {
|
|
35
|
-
return (source) => new
|
|
32
|
+
return (source) => new Observable(subscriber => {
|
|
36
33
|
const callNext = input => {
|
|
37
34
|
const next = () => {
|
|
38
35
|
if (!subscriber.closed) {
|
|
@@ -57,5 +54,4 @@ class AsyncContextProvider {
|
|
|
57
54
|
});
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
|
-
exports.AsyncContextProvider = AsyncContextProvider;
|
|
61
57
|
//# sourceMappingURL=async-context.provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-context.provider.js","sourceRoot":"","sources":["../src/async-context.provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"async-context.provider.js","sourceRoot":"","sources":["../src/async-context.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAEN,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,UAAU,CAAI,UAAU,CAAC,EAAE;YAChE,MAAM,QAAQ,GAAoB,KAAK,CAAC,EAAE;gBACzC,MAAM,IAAI,GAAG,GAAS,EAAE;oBACvB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;wBACxB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACxB,CAAC;gBACF,CAAC,CAAC;gBACF,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACrB,CAAC,CAAC;YACF,MAAM,SAAS,GAAoB,KAAK,CAAC,EAAE;gBAC1C,MAAM,IAAI,GAAG,GAAS,EAAE;oBACvB,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;wBACxB,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACzB,CAAC;gBACF,CAAC,CAAC;gBACF,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACrB,CAAC,CAAC;YAEF,MAAM,CAAC,SAAS,CAAC;gBAChB,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,SAAS;gBAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE;aACrC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-context.test.d.ts","sourceRoot":"","sources":["../src/async-context.test.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"async-context.test.d.ts","sourceRoot":"","sources":["../src/async-context.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,EAEL,MAAM,cAAc,CAAC;AAiBtB,qBACa,gBAAiB,SAAQ,KAAK;IAC1C,OAAO,CAAC,OAAO,CAA+B;IAGjC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBjC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB/B,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAUhC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUpC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUzC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAWzC,iCAAiC,IAAI,OAAO,CAAC,IAAI,CAAC;IAYlD,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjD,OAAO,CAAC,8BAA8B;CAgCtC"}
|
|
@@ -1,95 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const async_context_not_found_exception_1 = require("./async-context.not-found.exception");
|
|
8
|
-
const async_context_provider_1 = require("./async-context.provider");
|
|
9
|
-
let AsyncContextTest = class AsyncContextTest extends tests_1.Suite {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Describe, expect, ExpectException, Suite, Test, } from '@hg-ts/tests';
|
|
3
|
+
import { Subject, tap, } from 'rxjs';
|
|
4
|
+
import { AsyncContextNotFoundException } from './async-context.not-found.exception.js';
|
|
5
|
+
import { AsyncContextProvider } from './async-context.provider.js';
|
|
6
|
+
let AsyncContextTest = class AsyncContextTest extends Suite {
|
|
10
7
|
context;
|
|
11
8
|
async emptyContext() {
|
|
12
|
-
|
|
9
|
+
expect(this.context.get()).toBe(null);
|
|
13
10
|
}
|
|
14
11
|
async noPromiseContext() {
|
|
15
12
|
const contextValue = Math.random();
|
|
16
13
|
const resultValue = Math.random();
|
|
17
14
|
const result = this.context.run(contextValue, () => {
|
|
18
|
-
|
|
15
|
+
expect(this.context.getOrFail()).toBe(contextValue);
|
|
19
16
|
this.context.exit(() => {
|
|
20
|
-
|
|
17
|
+
expect(this.context.get()).toBe(null);
|
|
21
18
|
});
|
|
22
19
|
return resultValue;
|
|
23
20
|
});
|
|
24
|
-
|
|
21
|
+
expect(result).toBe(resultValue);
|
|
25
22
|
}
|
|
26
23
|
async promiseContext() {
|
|
27
24
|
const contextValue = Math.random();
|
|
28
25
|
const resultValue = Math.random();
|
|
29
26
|
const result = await this.context.run(contextValue, async () => {
|
|
30
|
-
|
|
27
|
+
expect(this.context.getOrFail()).toBe(contextValue);
|
|
31
28
|
await this.context.exit(async () => {
|
|
32
|
-
|
|
29
|
+
expect(this.context.get()).toBe(null);
|
|
33
30
|
});
|
|
34
31
|
return resultValue;
|
|
35
32
|
});
|
|
36
|
-
|
|
33
|
+
expect(result).toBe(resultValue);
|
|
37
34
|
}
|
|
38
35
|
async operatorContext() {
|
|
39
36
|
const { subject, input } = this.createOperatorTestSubscription();
|
|
40
37
|
subject.next(input);
|
|
41
38
|
subject.complete();
|
|
42
|
-
|
|
39
|
+
expect.assertions(4);
|
|
43
40
|
}
|
|
44
41
|
async operatorWithFactory() {
|
|
45
42
|
const { subject, input } = this.createOperatorTestSubscription(value => -value);
|
|
46
43
|
subject.next(input);
|
|
47
44
|
subject.complete();
|
|
48
|
-
|
|
45
|
+
expect.assertions(4);
|
|
49
46
|
}
|
|
50
47
|
async operatorWithErrorContext() {
|
|
51
48
|
const { subject, input } = this.createOperatorTestSubscription();
|
|
52
49
|
subject.error(input);
|
|
53
50
|
subject.complete();
|
|
54
|
-
|
|
51
|
+
expect.assertions(4);
|
|
55
52
|
}
|
|
56
53
|
async operatorAfterUnsubscribe() {
|
|
57
54
|
const { subject, input, subscription } = this.createOperatorTestSubscription();
|
|
58
55
|
subscription.unsubscribe();
|
|
59
56
|
subject.next(input);
|
|
60
57
|
subject.complete();
|
|
61
|
-
|
|
58
|
+
expect.assertions(2);
|
|
62
59
|
}
|
|
63
60
|
async operatorWithErrorAfterUnsubscribe() {
|
|
64
61
|
const { subject, input, subscription } = this.createOperatorTestSubscription();
|
|
65
62
|
subscription.unsubscribe();
|
|
66
63
|
subject.error(input);
|
|
67
64
|
subject.complete();
|
|
68
|
-
|
|
65
|
+
expect.assertions(2);
|
|
69
66
|
}
|
|
70
67
|
async contextNotFound() {
|
|
71
68
|
this.context.getOrFail();
|
|
72
69
|
}
|
|
73
70
|
async beforeEach() {
|
|
74
|
-
this.context = new
|
|
71
|
+
this.context = new AsyncContextProvider();
|
|
75
72
|
}
|
|
76
73
|
createOperatorTestSubscription(factory) {
|
|
77
|
-
const subject = new
|
|
74
|
+
const subject = new Subject();
|
|
78
75
|
const input = Math.random();
|
|
79
76
|
const context = factory ? factory(input) : input;
|
|
80
77
|
const withContext = (value) => {
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
expect(value).toBe(input);
|
|
79
|
+
expect(this.context.getOrFail()).toBe(context);
|
|
83
80
|
};
|
|
84
81
|
const withoutContext = (value) => {
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
expect(value).toBe(input);
|
|
83
|
+
expect(this.context.get()).toBe(null);
|
|
87
84
|
};
|
|
88
85
|
const subscription = subject.asObservable()
|
|
89
|
-
.pipe(this.context.runOperator(factory),
|
|
86
|
+
.pipe(this.context.runOperator(factory), tap({
|
|
90
87
|
next: withContext,
|
|
91
88
|
error: withContext,
|
|
92
|
-
}), this.context.exitOperator(),
|
|
89
|
+
}), this.context.exitOperator(), tap({
|
|
93
90
|
next: withoutContext,
|
|
94
91
|
error: withoutContext,
|
|
95
92
|
}))
|
|
@@ -97,63 +94,63 @@ let AsyncContextTest = class AsyncContextTest extends tests_1.Suite {
|
|
|
97
94
|
return { subject, subscription, input, context };
|
|
98
95
|
}
|
|
99
96
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
97
|
+
__decorate([
|
|
98
|
+
Test(),
|
|
99
|
+
__metadata("design:type", Function),
|
|
100
|
+
__metadata("design:paramtypes", []),
|
|
101
|
+
__metadata("design:returntype", Promise)
|
|
106
102
|
], AsyncContextTest.prototype, "emptyContext", null);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
103
|
+
__decorate([
|
|
104
|
+
Test(),
|
|
105
|
+
__metadata("design:type", Function),
|
|
106
|
+
__metadata("design:paramtypes", []),
|
|
107
|
+
__metadata("design:returntype", Promise)
|
|
112
108
|
], AsyncContextTest.prototype, "noPromiseContext", null);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
__decorate([
|
|
110
|
+
Test(),
|
|
111
|
+
__metadata("design:type", Function),
|
|
112
|
+
__metadata("design:paramtypes", []),
|
|
113
|
+
__metadata("design:returntype", Promise)
|
|
118
114
|
], AsyncContextTest.prototype, "promiseContext", null);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
__decorate([
|
|
116
|
+
Test(),
|
|
117
|
+
__metadata("design:type", Function),
|
|
118
|
+
__metadata("design:paramtypes", []),
|
|
119
|
+
__metadata("design:returntype", Promise)
|
|
124
120
|
], AsyncContextTest.prototype, "operatorContext", null);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
__decorate([
|
|
122
|
+
Test(),
|
|
123
|
+
__metadata("design:type", Function),
|
|
124
|
+
__metadata("design:paramtypes", []),
|
|
125
|
+
__metadata("design:returntype", Promise)
|
|
130
126
|
], AsyncContextTest.prototype, "operatorWithFactory", null);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
__decorate([
|
|
128
|
+
Test(),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", []),
|
|
131
|
+
__metadata("design:returntype", Promise)
|
|
136
132
|
], AsyncContextTest.prototype, "operatorWithErrorContext", null);
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
__decorate([
|
|
134
|
+
Test(),
|
|
135
|
+
__metadata("design:type", Function),
|
|
136
|
+
__metadata("design:paramtypes", []),
|
|
137
|
+
__metadata("design:returntype", Promise)
|
|
142
138
|
], AsyncContextTest.prototype, "operatorAfterUnsubscribe", null);
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
__decorate([
|
|
140
|
+
Test(),
|
|
141
|
+
__metadata("design:type", Function),
|
|
142
|
+
__metadata("design:paramtypes", []),
|
|
143
|
+
__metadata("design:returntype", Promise)
|
|
148
144
|
], AsyncContextTest.prototype, "operatorWithErrorAfterUnsubscribe", null);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
__decorate([
|
|
146
|
+
Test(),
|
|
147
|
+
ExpectException(AsyncContextNotFoundException),
|
|
148
|
+
__metadata("design:type", Function),
|
|
149
|
+
__metadata("design:paramtypes", []),
|
|
150
|
+
__metadata("design:returntype", Promise)
|
|
155
151
|
], AsyncContextTest.prototype, "contextNotFound", null);
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
AsyncContextTest = __decorate([
|
|
153
|
+
Describe()
|
|
158
154
|
], AsyncContextTest);
|
|
155
|
+
export { AsyncContextTest };
|
|
159
156
|
//# sourceMappingURL=async-context.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-context.test.js","sourceRoot":"","sources":["../src/async-context.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"async-context.test.js","sourceRoot":"","sources":["../src/async-context.test.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,QAAQ,EACR,MAAM,EACN,eAAe,EACf,KAAK,EACL,IAAI,GACJ,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,OAAO,EAEP,GAAG,GACH,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC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9C,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,EAAE;aACzC,IAAI,CACJ,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EACjC,GAAG,CAAC;YACH,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;SAClB,CAAC,EACF,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAC3B,GAAG,CAAC;YACH,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,cAAc;SACrB,CAAC,CACF;aACA,SAAS,CAAC,EAAE,IAAI,KAAI,CAAC,EAAE,KAAK,KAAI,CAAC,EAAE,CAAC,CAAC;QAEvC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAClD,CAAC;CACD,CAAA;AApIa;IADZ,IAAI,EAAE;;;;oDAGN;AAGY;IADZ,IAAI,EAAE;;;;wDAeN;AAGY;IADZ,IAAI,EAAE;;;;sDAeN;AAGY;IADZ,IAAI,EAAE;;;;uDAQN;AAGY;IADZ,IAAI,EAAE;;;;2DAQN;AAGY;IADZ,IAAI,EAAE;;;;gEAQN;AAGY;IADZ,IAAI,EAAE;;;;gEASN;AAGY;IADZ,IAAI,EAAE;;;;yEASN;AAIY;IAFZ,IAAI,EAAE;IACN,eAAe,CAAC,6BAA6B,CAAC;;;;uDAG9C;AAlGW,gBAAgB;IAD5B,QAAQ,EAAE;GACE,gBAAgB,CAwI5B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './async-context.provider';
|
|
2
|
-
export * from './async-context.not-found.exception';
|
|
1
|
+
export * from './async-context.provider.js';
|
|
2
|
+
export * from './async-context.not-found.exception.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./async-context.provider"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./async-context.not-found.exception"), exports);
|
|
1
|
+
export * from './async-context.provider.js';
|
|
2
|
+
export * from './async-context.not-found.exception.js';
|
|
6
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wCAAwC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hg-ts/async-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": "./dist/index.js"
|
|
7
8
|
},
|
|
@@ -17,11 +18,11 @@
|
|
|
17
18
|
"test:dev": "HG_ENV=test vitest watch"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@hg-ts-config/typescript": "0.
|
|
21
|
-
"@hg-ts/exception": "0.
|
|
22
|
-
"@hg-ts/linter": "0.
|
|
23
|
-
"@hg-ts/tests": "0.
|
|
24
|
-
"@hg-ts/types": "0.
|
|
21
|
+
"@hg-ts-config/typescript": "0.4.1",
|
|
22
|
+
"@hg-ts/exception": "0.4.1",
|
|
23
|
+
"@hg-ts/linter": "0.4.1",
|
|
24
|
+
"@hg-ts/tests": "0.4.1",
|
|
25
|
+
"@hg-ts/types": "0.4.1",
|
|
25
26
|
"@types/node": "22.19.1",
|
|
26
27
|
"@vitest/coverage-v8": "4.0.14",
|
|
27
28
|
"eslint": "9.18.0",
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"vitest": "4.0.14"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
|
-
"@hg-ts/exception": "0.
|
|
38
|
+
"@hg-ts/exception": "0.4.1",
|
|
38
39
|
"reflect-metadata": "*",
|
|
39
40
|
"rxjs": "*",
|
|
40
41
|
"tslib": "*",
|
package/tsconfig.json
CHANGED