@guanghechen/disposable 1.0.0-alpha.3 → 1.0.0-alpha.4
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/CHANGELOG.md +14 -0
- package/lib/cjs/index.cjs +3 -3
- package/lib/esm/index.mjs +3 -3
- package/lib/types/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.4](https://github.com/guanghechen/sora/compare/@guanghechen/disposable@1.0.0-alpha.3...@guanghechen/disposable@1.0.0-alpha.4) (2024-03-10)
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
- :art: format codes
|
|
11
|
+
([177eb54](https://github.com/guanghechen/sora/commit/177eb5407fe9209269541a327d42084901a63090))
|
|
12
|
+
- 🎨 add @guanghechen/monitor back
|
|
13
|
+
([4c75f05](https://github.com/guanghechen/sora/commit/4c75f05441f57eb2428c086aea20c733f4a730c5))
|
|
14
|
+
|
|
15
|
+
# Change Log
|
|
16
|
+
|
|
17
|
+
All notable changes to this project will be documented in this file. See
|
|
18
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
19
|
+
|
|
6
20
|
# [1.0.0-alpha.3](https://github.com/guanghechen/sora/compare/@guanghechen/disposable@1.0.0-alpha.2...@guanghechen/disposable@1.0.0-alpha.3) (2024-03-09)
|
|
7
21
|
|
|
8
22
|
### Performance Improvements
|
package/lib/cjs/index.cjs
CHANGED
|
@@ -22,12 +22,12 @@ class SafeBatchHandler {
|
|
|
22
22
|
this._summary = undefined;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
summary() {
|
|
25
|
+
summary(errorSummary) {
|
|
26
26
|
if (this._summary === undefined) {
|
|
27
27
|
if (this._errors.length === 1)
|
|
28
28
|
throw (this._summary = this._errors[0]);
|
|
29
29
|
if (this._errors.length > 1) {
|
|
30
|
-
this._summary = new AggregateError(this._errors,
|
|
30
|
+
this._summary = new AggregateError(this._errors, errorSummary);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
if (this._summary !== undefined)
|
|
@@ -38,7 +38,7 @@ function disposeAll(disposables) {
|
|
|
38
38
|
const handler = new SafeBatchHandler();
|
|
39
39
|
for (const disposable of disposables)
|
|
40
40
|
handler.run(() => disposable.dispose());
|
|
41
|
-
handler.summary();
|
|
41
|
+
handler.summary('[disposeAll] Encountered errors while disposing');
|
|
42
42
|
handler.cleanup();
|
|
43
43
|
}
|
|
44
44
|
|
package/lib/esm/index.mjs
CHANGED
|
@@ -20,12 +20,12 @@ class SafeBatchHandler {
|
|
|
20
20
|
this._summary = undefined;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
summary() {
|
|
23
|
+
summary(errorSummary) {
|
|
24
24
|
if (this._summary === undefined) {
|
|
25
25
|
if (this._errors.length === 1)
|
|
26
26
|
throw (this._summary = this._errors[0]);
|
|
27
27
|
if (this._errors.length > 1) {
|
|
28
|
-
this._summary = new AggregateError(this._errors,
|
|
28
|
+
this._summary = new AggregateError(this._errors, errorSummary);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
if (this._summary !== undefined)
|
|
@@ -36,7 +36,7 @@ function disposeAll(disposables) {
|
|
|
36
36
|
const handler = new SafeBatchHandler();
|
|
37
37
|
for (const disposable of disposables)
|
|
38
38
|
handler.run(() => disposable.dispose());
|
|
39
|
-
handler.summary();
|
|
39
|
+
handler.summary('[disposeAll] Encountered errors while disposing');
|
|
40
40
|
handler.cleanup();
|
|
41
41
|
}
|
|
42
42
|
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare class SafeBatchHandler {
|
|
|
24
24
|
constructor();
|
|
25
25
|
cleanup(): void;
|
|
26
26
|
run(action: () => void): void;
|
|
27
|
-
summary(): void | never;
|
|
27
|
+
summary(errorSummary: string): void | never;
|
|
28
28
|
}
|
|
29
29
|
declare function disposeAll(disposables: Iterable<IDisposable>): void | never;
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guanghechen/disposable",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/guanghechen/sora/tree/@guanghechen/disposable@1.0.0-alpha.
|
|
10
|
+
"url": "https://github.com/guanghechen/sora/tree/@guanghechen/disposable@1.0.0-alpha.3",
|
|
11
11
|
"directory": "packages/disposable"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/disposable@1.0.0-alpha.
|
|
13
|
+
"homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/disposable@1.0.0-alpha.3/packages/disposable#readme",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"disposable"
|
|
16
16
|
],
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@guanghechen/disposable.types": "^1.0.0-alpha.2"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "edc5a1b997fac81f96f1ba03200a13b829b3e91d"
|
|
40
40
|
}
|