*Update dist

This commit is contained in:
Derrick Hammer 2023-04-08 14:38:29 -04:00
parent c787d9e757
commit 05c9a7aea7
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
4 changed files with 10 additions and 7 deletions

View File

@ -42,7 +42,7 @@ export default class SimpleRpcQuery extends RpcQueryBase {
} }
this._relay = socket; this._relay = socket;
await socket.opened; await socket.opened;
const rpc = setupStream(socket); const rpc = await setupStream(socket);
if (this._query.bypassCache) { if (this._query.bypassCache) {
delete this._query.bypassCache; delete this._query.bypassCache;
await this.queryRpc(rpc, { await this.queryRpc(rpc, {

2
dist/util.d.ts vendored
View File

@ -14,6 +14,6 @@ export declare function validateTimestampedResponse(
): boolean; ): boolean;
export declare function hashQuery(query: RPCRequest): string; export declare function hashQuery(query: RPCRequest): string;
export declare function createHash(data: string): Buffer; export declare function createHash(data: string): Buffer;
export declare function setupStream(stream: any): any; export declare function setupStream(stream: any): Promise<any>;
export declare function maybeGetAsyncProperty(object: any): Promise<any>; export declare function maybeGetAsyncProperty(object: any): Promise<any>;
//# sourceMappingURL=util.d.ts.map //# sourceMappingURL=util.d.ts.map

2
dist/util.d.ts.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOxE,eAAO,MAAM,mBAAmB,eAAwB,CAAC;AAEzD,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,WAM1C;AAKD,wBAAgB,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,GAAG,GAAG,EAAE,CA0C1D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,EACrB,WAAW,UAAQ,GAClB,OAAO,CAkBT;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,GACpB,OAAO,CAET;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAUnD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,OAStC;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,GAAG,gBAUtD"} {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAOxE,eAAO,MAAM,mBAAmB,eAAwB,CAAC;AAEzD,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,WAM1C;AAKD,wBAAgB,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,GAAG,GAAG,EAAE,CA0C1D;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,EACrB,WAAW,UAAQ,GAClB,OAAO,CAkBT;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,GACpB,OAAO,CAET;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAUnD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,GAAG,gBAa5C;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,GAAG,gBAUtD"}

11
dist/util.js vendored
View File

@ -80,13 +80,16 @@ export function createHash(data) {
sodium.crypto_generichash(hash, buffer); sodium.crypto_generichash(hash, buffer);
return hash; return hash;
} }
export function setupStream(stream) { export async function setupStream(stream) {
const existing = stream[RPC_PROTOCOL_SYMBOL]; const existing = stream[RPC_PROTOCOL_SYMBOL];
if (existing) { if (!existing) {
await existing._channel.ready;
return existing; return existing;
} }
stream[RPC_PROTOCOL_SYMBOL] = new RPC(stream); const rpc = new RPC(stream);
return stream[RPC_PROTOCOL_SYMBOL]; stream[RPC_PROTOCOL_SYMBOL] = rpc;
await existing.ready;
return rpc;
} }
export async function maybeGetAsyncProperty(object) { export async function maybeGetAsyncProperty(object) {
if (typeof object === "function") { if (typeof object === "function") {