(text: string)
| 3 | const compactCommandPattern = /^\/compact(?:\s+([\s\S]*))?$/ |
| 4 | |
| 5 | export function parseCompactSlashCommand(text: string) { |
| 6 | const match = compactCommandPattern.exec(text.trim()) |
| 7 | if (!match) { |
| 8 | return null |
| 9 | } |
| 10 | |
| 11 | return match[1]?.trim() ?? '' |
| 12 | } |
| 13 | |
| 14 | export function isCompactSlashCommand(text: string) { |
| 15 | return parseCompactSlashCommand(text) !== null |
no test coverage detected