Merge pull request #28236 from element-hq/t3chguy/sonar-happy
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user