Make Sonar happier
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
eedeb2cdaf
commit
44b23d2191
17 changed files with 44 additions and 65 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue