(command: string[])
| 45 | * a double quote) so `tokenizeCommand` parses them back to the same list. |
| 46 | */ |
| 47 | export function formatCommand(command: string[]): string { |
| 48 | return command |
| 49 | .map((part) => { |
| 50 | if (part === "") return '""'; |
| 51 | if (!/\s/.test(part)) return part; |
| 52 | return part.includes('"') ? `'${part}'` : `"${part}"`; |
| 53 | }) |
| 54 | .join(" "); |
| 55 | } |
no outgoing calls
no test coverage detected