From 01bc9a8d15f32085f67321f7ba2757881e4ad470 Mon Sep 17 00:00:00 2001 From: Harvey Zuccon Date: Fri, 27 Feb 2026 00:38:27 +1100 Subject: [PATCH] Remove the overloads in epheraml transport --- src/transports/ephemeral-transport.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/transports/ephemeral-transport.ts b/src/transports/ephemeral-transport.ts index 0b0c817..9cb2364 100644 --- a/src/transports/ephemeral-transport.ts +++ b/src/transports/ephemeral-transport.ts @@ -17,17 +17,17 @@ export class EphemeralTransport { return response; } - async receive(url: string, schema: T): Promise>; - async receive(url: string): Promise; - async receive(url: string, schema?: ZodType): Promise { + async receive(url: string, schema?: T): Promise> { const transport = await this.transports(url); const message = await transport.waitFor('message', () => true); transport.disconnect(); if (schema) { - return schema.parse(message); + // TODO: Figure out how the hell to fix this assertion. It shouldnt be needed, but TS is being a bitch. + return schema.parse(message) as T extends undefined ? unknown : output; } - return message; + // TODO: Figure out how the hell to fix this assertion. It shouldnt be needed, but TS is being a bitch. + return message as T extends undefined ? unknown : output; } }