Skip to content

Commit

Permalink
docs: 📝 add missing jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardDorian committed Mar 30, 2022
1 parent 1d5d7a1 commit b799df7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ReadOnlyProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { EventEmitter } from 'node:events';
import TypedEmitter from 'typed-emitter';
import { Server, Socket, createServer } from 'node:net';

/**
* Read only proxy, read only proxies are proxies where you can only read packets
*/
export default class ReadOnlyProxy extends (EventEmitter as new () => TypedEmitter<ReadOnlyProxyEvents>) {
private readonly options: ReadOnlyProxyOptions;
private readonly sockets: ReadOnlyProxySocketMap[];
Expand Down Expand Up @@ -63,6 +66,10 @@ export default class ReadOnlyProxy extends (EventEmitter as new () => TypedEmitt
this.server.on('error', (error) => this.emit('error', 'server', error));
}

/**
* Log a debug message (only if debug is enabled)
* @param args Data to log
*/
private debug(...args) {
if (this.options.debug) console.log('[DEBUG]', ...args);
}
Expand Down

0 comments on commit b799df7

Please sign in to comment.