MCPcopy
hub / github.com/rpamis/comet / cleanCommandOutput

Function cleanCommandOutput

src/core/command-error.ts:17–26  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

15}
16
17function cleanCommandOutput(output: string): string {
18 return output
19 .replace(ANSI_ESCAPE_PATTERN, '')
20 .replace(LOOSE_ESCAPE_PATTERN, '')
21 .split('\n')
22 .map((line) => line.trimEnd())
23 .filter((line) => line.trim() && !/^(│|├|╮|╯|●|◇|◒|◐|◓|◑|■)/.test(line.trim()))
24 .join('\n')
25 .trim();
26}
27
28function formatCommandErrorDetails(error: unknown): string[] {
29 const details: string[] = [];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected