Merge pull request #28236 from element-hq/t3chguy/sonar-happy
This commit is contained in:
commit
4e93233a3d
18 changed files with 46 additions and 67 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