Skip to content

Commit

Permalink
Removed unnecessary variable assignment for debug and directly acce…
Browse files Browse the repository at this point in the history
…ssed `this.options.debug` instead, this enables changing the debug option on the fly and have the client print/stop as necessary. (#197)

Signed-off-by: Alberto Ricart <[email protected]>
  • Loading branch information
aricart authored Feb 1, 2025
1 parent ef2fd7b commit 6a0a9b7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions transport-node/src/node_transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ export class NodeTransport implements Transport {
}

async *iterate(): AsyncIterableIterator<Uint8Array> {
const debug = this.options.debug;
while (true) {
if (this.yields.length === 0) {
await this.signal;
Expand All @@ -376,7 +375,7 @@ export class NodeTransport implements Transport {
this.yields = [];

for (let i = 0; i < yields.length; i++) {
if (debug) {
if (this.options.debug) {
console.info(`> ${render(yields[i])}`);
}
yield yields[i];
Expand Down

0 comments on commit 6a0a9b7

Please sign in to comment.