* Refactor `util.ts` to use `existing.ready` instead of `existing._channel.ready` and replace `existing.ready` with `rpc.ready`.

This commit is contained in:
Derrick Hammer 2023-04-08 16:43:56 -04:00
parent 7386b6de05
commit a7e0fbd190
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -118,14 +118,14 @@ export function createHash(data: string): Buffer {
export async function setupStream(stream: any) {
const existing = stream[RPC_PROTOCOL_SYMBOL];
if (existing) {
await existing._channel.ready;
await existing.ready;
return existing;
}
const rpc = new RPC(stream);
stream[RPC_PROTOCOL_SYMBOL] = rpc;
await existing.ready;
await rpc.ready;
return rpc;
}