Browse Source

add trim()

zahmis 5 years ago
parent
commit
a27ea8edf7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/slack/src/utils/slash-command-parser.ts

+ 2 - 1
packages/slack/src/utils/slash-command-parser.ts

@@ -2,7 +2,8 @@ import { GrowiCommand } from '../interfaces/growi-command';
 import { InvalidGrowiCommandError } from '../models/errors';
 
 export const parse = (slashCommand:{[key:string]:string}): GrowiCommand => {
-  const splitted = slashCommand.text.split(' ');
+  const trimmedText = slashCommand.text.trim();
+  const splitted = trimmedText.split(' ');
   console.log('slash-command', splitted);
 
   if (splitted[0] === '') {