Skip to content

Commit 3efee2a

Browse files
committed
refactor: replace any with never in generic API handler calls
- Change type parameter from <any> to <never> in #handleApiError and #handleApiSuccess calls - Affects get(), send(), and uploadManifestFiles() methods that don't map to specific API operations
1 parent b6af284 commit 3efee2a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/socket-sdk-class.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ export class SocketSdk {
898898
if (throws) {
899899
throw new ResponseError(response)
900900
}
901-
const errorResult = await this.#handleApiError<any>(
901+
const errorResult = await this.#handleApiError<never>(
902902
new ResponseError(response),
903903
)
904904
return {
@@ -935,7 +935,7 @@ export class SocketSdk {
935935
/* c8 ignore start - Defensive fallback: ResponseError in catch block handled in try block (lines 897-910) */
936936
if (e instanceof ResponseError) {
937937
// Re-use existing error handling logic from the SDK
938-
const errorResult = await this.#handleApiError<any>(e)
938+
const errorResult = await this.#handleApiError<never>(e)
939939
return {
940940
cause: errorResult.cause,
941941
data: undefined,
@@ -1724,7 +1724,7 @@ export class SocketSdk {
17241724
/* c8 ignore start - Defensive fallback: ResponseError in catch block handled in try block (lines 1686-1695) */
17251725
if (e instanceof ResponseError) {
17261726
// Re-use existing error handling logic from the SDK
1727-
const errorResult = await this.#handleApiError<any>(e)
1727+
const errorResult = await this.#handleApiError<never>(e)
17281728
return {
17291729
cause: errorResult.cause,
17301730
data: undefined,
@@ -2001,12 +2001,12 @@ export class SocketSdk {
20012001
this.#reqOptions,
20022002
),
20032003
)
2004-
return this.#handleApiSuccess<any>(
2004+
return this.#handleApiSuccess<never>(
20052005
data,
20062006
) as unknown as UploadManifestFilesReturnType
20072007
} catch (e) {
20082008
/* c8 ignore start - Error handling in uploadManifestFiles method for edge cases. */
2009-
return (await this.#handleApiError<any>(
2009+
return (await this.#handleApiError<never>(
20102010
e,
20112011
)) as unknown as UploadManifestFilesError
20122012
/* c8 ignore stop */

0 commit comments

Comments
 (0)