Make Sonar happier

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-16 17:38:22 +01:00
parent eedeb2cdaf
commit 44b23d2191
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
17 changed files with 44 additions and 65 deletions

View file

@ -450,7 +450,7 @@ export const Commands = [
const matches = args.match(/^(\S+)$/);
if (matches) {
let roomAlias = matches[1];
if (roomAlias[0] !== "#") return reject(this.getUsage());
if (!roomAlias.startsWith("#")) return reject(this.getUsage());
if (!roomAlias.includes(":")) {
roomAlias += ":" + cli.getDomain();
@ -994,7 +994,7 @@ Commands.forEach((cmd) => {
export function parseCommandString(input: string): { cmd?: string; args?: string } {
// trim any trailing whitespace, as it can confuse the parser for IRC-style commands
input = input.trimEnd();
if (input[0] !== "/") return {}; // not a command
if (input.startsWith("/")) return {}; // not a command
const bits = input.match(/^(\S+?)(?:[ \n]+((.|\n)*))?$/);
let cmd: string;