(
dirPath: string,
options?: { withFileTypes?: boolean; encoding?: BufferEncoding }
)
| 212 | options: { withFileTypes: true; encoding?: BufferEncoding } |
| 213 | ): Promise<Dirent[]>; |
| 214 | export async function readdir( |
| 215 | dirPath: string, |
| 216 | options?: { withFileTypes?: boolean; encoding?: BufferEncoding } |
| 217 | ): Promise<string[] | Dirent[]> { |
| 218 | const validatedPath = validatePath(dirPath); |
| 219 | return executeWithRetry<string[] | Dirent[]>(() => { |
| 220 | if (options?.withFileTypes === true) { |
| 221 | return fs.readdir(validatedPath, { withFileTypes: true }); |
| 222 | } |
| 223 | return fs.readdir(validatedPath); |
| 224 | }, `readdir(${dirPath})`); |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * Wrapper around fs.stat that validates path first |
nothing calls this directly
no test coverage detected