Skip to content

Commit

Permalink
Remove misleading comment (#370)
Browse files Browse the repository at this point in the history
The comment falsely indicates that malformed IRC messages would
be null.

However, since the switch to a proper parser the function always
returns an IrcMessage object, no matter how broken the input is.

```
const parser = require('./src/irclineparser');
console.log(parser('\0'));

// IrcMessage {
//   tags: [Object: null prototype] {},
//   prefix: '',
//   nick: '',
//   ident: '',
//   hostname: '',
//   command: '\x00',
//   params: []
// }
```

Hence, remove the comment to avoid misleading readers
but keep the guard, should the parser change in the future.
  • Loading branch information
brunnre8 authored Jan 10, 2024
1 parent f2989ca commit fa79f5d
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ module.exports = class Connection extends EventEmitter {

const message = ircLineParser(line);
if (!message) {
// A malformed IRC line
return;
}

Expand Down

0 comments on commit fa79f5d

Please sign in to comment.