MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / isSlashCommand

Function isSlashCommand

src/utils/queueProcessor.ts:20–37  ·  view source on GitHub ↗

* Check if a queued command is a slash command (value starts with '/').

(cmd: QueuedCommand)

Source from the content-addressed store, hash-verified

18 * Check if a queued command is a slash command (value starts with '/').
19 */
20function isSlashCommand(cmd: QueuedCommand): boolean {
21 if (typeof cmd.value === 'string') {
22 return (
23 cmd.value.trim().startsWith('/') &&
24 (!cmd.skipSlashCommands || cmd.bridgeOrigin === true)
25 )
26 }
27 // For ContentBlockParam[], check the first text block
28 for (const block of cmd.value) {
29 if (block.type === 'text') {
30 return (
31 block.text.trim().startsWith('/') &&
32 (!cmd.skipSlashCommands || cmd.bridgeOrigin === true)
33 )
34 }
35 }
36 return false
37}
38
39/**
40 * Processes commands from the queue.

Callers 3

processQueueIfReadyFunction · 0.70
queryLoopFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected