Skip to content

Commit

Permalink
Remove misleading comment
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 committed Dec 27, 2023
1 parent f2989ca commit e1e0f87
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 e1e0f87

Please sign in to comment.