MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / describeTerminalInput

Function describeTerminalInput

ui/src/components/workspace/terminalInput.ts:30–43  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

28}
29
30export function describeTerminalInput(data: string): string {
31 return Array.from(data)
32 .map((ch) => {
33 const code = ch.codePointAt(0) ?? 0
34 const hex = code.toString(16).toUpperCase().padStart(4, '0')
35 const label =
36 ch === '\r' ? 'CR'
37 : ch === '\n' ? 'LF'
38 : ch === '\x1b' ? 'ESC'
39 : ch
40 return `${label}=U+${hex}`
41 })
42 .join(' ')
43}

Callers 2

logInputFunction · 0.90

Calls 2

fromMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected