MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / parseCompactSlashCommand

Function parseCompactSlashCommand

shared/composer-slash-commands.ts:5–12  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

3const compactCommandPattern = /^\/compact(?:\s+([\s\S]*))?$/
4
5export 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
14export function isCompactSlashCommand(text: string) {
15 return parseCompactSlashCommand(text) !== null

Callers 3

sendComposerPromptFunction · 0.90
sendComposerPromptFunction · 0.90
isCompactSlashCommandFunction · 0.85

Calls 1

execMethod · 0.80

Tested by

no test coverage detected