Browse Source

add trim()

zahmis 5 năm trước cách đây
mục cha
commit
a27ea8edf7
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  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] === '') {