Closed chlohe closed 3 years ago
Describe the bug Setting muteEnabled = false in AntiSpamClientOptions doesn't work.
muteEnabled = false
AntiSpamClientOptions
To Reproduce Steps to reproduce the behavior:
const antiSpam = new AntiSpam({ muteEnabled: false });
console.log(antiSpam);
muteEnabled
true
Expected behavior The muteEnabled field says false.
false
Cause See index.js: warnEnabled: options.warnEnabled || true is always going to evaluate to true by definition of ||.
index.js
warnEnabled: options.warnEnabled || true
||
This bug also affects a couple of other options.
Describe the bug Setting
muteEnabled = false
inAntiSpamClientOptions
doesn't work.To Reproduce Steps to reproduce the behavior:
const antiSpam = new AntiSpam({ muteEnabled: false });
console.log(antiSpam);
muteEnabled
field saystrue
.Expected behavior The
muteEnabled
field saysfalse
.Cause See
index.js
:warnEnabled: options.warnEnabled || true
is always going to evaluate totrue
by definition of||
.This bug also affects a couple of other options.