Skip to content

Commit b920f4c

Browse files
committed
Remove unwanted console.debug
1 parent 7a91ad4 commit b920f4c

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/index.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ export class Procedure<Input = undefined, Output = undefined>
3838
extends (EventEmitter as {
3939
new <Input>(): TypedEmitter<ProcedureEvents<Input>>;
4040
})<Input>
41-
implements ProcedureDefinitionOptions
42-
{
41+
implements ProcedureDefinitionOptions {
4342
#endpoint?: string;
4443
/**
4544
* The endpoint at which the {@link Procedure}, when {@link bind bound}, can be {@link call called}.
@@ -163,7 +162,7 @@ export class Procedure<Input = undefined, Output = undefined>
163162
for (let i = 0; i < this.workers; i++) {
164163
const socket =
165164
this.sockets[
166-
this.sockets.push(createSocket('rep', { ipv6 })) - 1
165+
this.sockets.push(createSocket('rep', { ipv6 })) - 1
167166
];
168167
socket
169168
.on('data', (data: Buffer) =>
@@ -231,9 +230,9 @@ export class Procedure<Input = undefined, Output = undefined>
231230
output:
232231
(await this.callback(
233232
input ??
234-
((this.optionalParameterSupport
235-
? undefined
236-
: input) as Input)
233+
((this.optionalParameterSupport
234+
? undefined
235+
: input) as Input)
237236
)) ?? null,
238237
};
239238
} catch (e) {
@@ -621,12 +620,12 @@ export async function call<Output = unknown>(
621620
try {
622621
await (opts.pingCacheLength
623622
? cachedPing(
624-
endpoint,
625-
opts.ping,
626-
opts.pingCacheLength,
627-
opts.ipv6,
628-
opts.signal
629-
)
623+
endpoint,
624+
opts.ping,
625+
opts.pingCacheLength,
626+
opts.ipv6,
627+
opts.signal
628+
)
630629
: ping(endpoint, opts.ping, opts.ipv6, opts.signal));
631630
} catch (error) {
632631
const isTimeoutError = (error: unknown): boolean =>
@@ -637,7 +636,6 @@ export async function call<Output = unknown>(
637636
e instanceof ProcedureTimedOutError ||
638637
isTimeoutError(e)
639638
));
640-
if (!isTimeoutError(error)) console.debug(error);
641639
throw isTimeoutError(error)
642640
? new ProcedureNotFoundError() // timeout on ping = not found
643641
: error;
@@ -650,8 +648,8 @@ export async function call<Output = unknown>(
650648
if ('output' in response && !('error' in response)) {
651649
// success!
652650
return response.output ?? <Output>(opts.optionalParameterSupport
653-
? undefined // coerce null to undefined
654-
: response.output);
651+
? undefined // coerce null to undefined
652+
: response.output);
655653
} else if (isProcedureError(response.error)) {
656654
// response indicates an error happened server-side
657655
throw response.error;
@@ -741,9 +739,9 @@ async function cachedPing(
741739
cachedPingsByEndpoint[endpoint].resolving = cachedPingsByEndpoint[endpoint]
742740
.resolving
743741
? Promise.any<void>([
744-
cachedPingsByEndpoint[endpoint].resolving,
745-
ping(endpoint, timeout, ipv6, signal),
746-
])
742+
cachedPingsByEndpoint[endpoint].resolving,
743+
ping(endpoint, timeout, ipv6, signal),
744+
])
747745
: ping(endpoint, timeout, ipv6, signal);
748746

749747
await cachedPingsByEndpoint[endpoint].resolving;

0 commit comments

Comments
 (0)