( searchPattern: string, searchDir: string, )
| 159 | } |
| 160 | |
| 161 | async function isExactDirectoryPattern( |
| 162 | searchPattern: string, |
| 163 | searchDir: string, |
| 164 | ): Promise<boolean> { |
| 165 | const normalized = normalizeGlobPattern(searchPattern).replace(/\/+$/, '') |
| 166 | if (!normalized || hasGlobCharacters(normalized)) { |
| 167 | return false |
| 168 | } |
| 169 | try { |
| 170 | const fs = getFsImplementation() |
| 171 | const stats = await fs.stat(join(searchDir, normalized)) |
| 172 | return stats.isDirectory() |
| 173 | } catch { |
| 174 | return false |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | async function globDirectories( |
| 179 | searchPattern: string, |
no test coverage detected