MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / flattenUserContent

Function flattenUserContent

lib/transcript.js:54–63  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

52}
53
54function flattenUserContent(content) {
55 if (typeof content === 'string') return content;
56 if (!Array.isArray(content)) return '';
57 return content.map(block => {
58 if (!block || typeof block !== 'object') return '';
59 if (typeof block.text === 'string') return block.text;
60 if (typeof block.content === 'string') return block.content;
61 return '';
62 }).filter(Boolean).join('\n');
63}
64
65function extractSlashCommand(content) {
66 const text = flattenUserContent(content).trim();

Callers 5

extractSlashCommandFunction · 0.85
isUserInterruptEventFunction · 0.85
isNonAiUserEventFunction · 0.85
extractSessionPromptFunction · 0.85
test-modules.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected