[FIX] Outgoing integrations without trigger words or with multiple commas (#19488)
Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz> Co-authored-by: Diego Sampaio <chinello@gmail.com>pull/19643/head
parent
baadaacd68
commit
0d6175d6b3
@ -0,0 +1,13 @@ |
|||||||
|
const separator = ','; |
||||||
|
|
||||||
|
export function triggerWordsToArray(s?: string): Array<string> { |
||||||
|
if (typeof s !== 'string' || s.length === 0) { |
||||||
|
return []; |
||||||
|
} |
||||||
|
|
||||||
|
return s.split(separator); |
||||||
|
} |
||||||
|
|
||||||
|
export function triggerWordsToString(triggerWords?: Array<string>): string { |
||||||
|
return triggerWords?.join(separator) ?? ''; |
||||||
|
} |
Loading…
Reference in new issue