(command: string)
| 2601 | * DIRECTORY_CHANGE_ALIASES (src/utils/powershell/parser.ts). |
| 2602 | */ |
| 2603 | export function isNormalizedCdCommand(command: string): boolean { |
| 2604 | const stripped = stripSafeWrappers(command) |
| 2605 | const parsed = tryParseShellCommand(stripped) |
| 2606 | if (parsed.success && parsed.tokens.length > 0) { |
| 2607 | const cmd = parsed.tokens[0] |
| 2608 | return cmd === 'cd' || cmd === 'pushd' || cmd === 'popd' |
| 2609 | } |
| 2610 | return /^(?:cd|pushd|popd)(?:\s|$)/.test(stripped) |
| 2611 | } |
| 2612 | |
| 2613 | /** |
| 2614 | * Checks if a compound command contains any cd command, |
no test coverage detected