@@ -111,11 +111,13 @@ export class CancelablePromise<T> implements Promise<T> {
111
111
return this.#promise.then(onFulfilled, onRejected);
112
112
}
113
113
114
- public catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {
114
+ public catch<TResult = never>(
115
+ onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
116
+ ): Promise<T | TResult> {
115
117
return this.#promise.catch(onRejected);
116
118
}
117
119
118
- public finally(onFinally?: (() => void) | undefined | null): Promise<T> {
120
+ public finally(onFinally?: (() => void) | null): Promise<T> {
119
121
return this.#promise.finally(onFinally);
120
122
}
121
123
@@ -129,7 +131,7 @@ export class CancelablePromise<T> implements Promise<T> {
129
131
for (const cancelHandler of this.#cancelHandlers) {
130
132
cancelHandler();
131
133
}
132
- } catch(error) {
134
+ } catch (error) {
133
135
this.#reject?.(error);
134
136
return;
135
137
}
@@ -2582,11 +2584,13 @@ export class CancelablePromise<T> implements Promise<T> {
2582
2584
return this.#promise.then(onFulfilled, onRejected);
2583
2585
}
2584
2586
2585
- public catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {
2587
+ public catch<TResult = never>(
2588
+ onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
2589
+ ): Promise<T | TResult> {
2586
2590
return this.#promise.catch(onRejected);
2587
2591
}
2588
2592
2589
- public finally(onFinally?: (() => void) | undefined | null): Promise<T> {
2593
+ public finally(onFinally?: (() => void) | null): Promise<T> {
2590
2594
return this.#promise.finally(onFinally);
2591
2595
}
2592
2596
@@ -2600,7 +2604,7 @@ export class CancelablePromise<T> implements Promise<T> {
2600
2604
for (const cancelHandler of this.#cancelHandlers) {
2601
2605
cancelHandler();
2602
2606
}
2603
- } catch(error) {
2607
+ } catch (error) {
2604
2608
this.#reject?.(error);
2605
2609
return;
2606
2610
}
0 commit comments