From 881a0ce0e8bb98a81621e43c176f35b65c21accf Mon Sep 17 00:00:00 2001 From: Jerome Date: Mon, 16 Dec 2024 16:50:05 +0000 Subject: [PATCH] Destructured progress and total from notification params object --- src/shared/protocol.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/protocol.ts b/src/shared/protocol.ts index 42cec89..f430b31 100644 --- a/src/shared/protocol.ts +++ b/src/shared/protocol.ts @@ -278,7 +278,7 @@ export abstract class Protocol< } private _onprogress(notification: ProgressNotification): void { - const { progress, total, progressToken } = notification.params; + const { progressToken, ...params } = notification.params; const handler = this._progressHandlers.get(Number(progressToken)); if (handler === undefined) { this._onerror( @@ -289,7 +289,7 @@ export abstract class Protocol< return; } - handler({ progress, total }); + handler(params); } private _onresponse(response: JSONRPCResponse | JSONRPCError): void {