(dir: string, name: string)
| 41 | } |
| 42 | |
| 43 | async function entryFor(dir: string, name: string): Promise<PathEntry | null> { |
| 44 | const fullPath = path.join(dir, name) |
| 45 | try { |
| 46 | const stat = await fs.lstat(fullPath) |
| 47 | return { |
| 48 | name, |
| 49 | path: fullPath, |
| 50 | isDir: stat.isDirectory(), |
| 51 | isSymlink: stat.isSymbolicLink(), |
| 52 | size: stat.size, |
| 53 | mode: stat.mode, |
| 54 | } |
| 55 | } catch { |
| 56 | return null |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | async function readFileSample(filePath: string, size: number): Promise<Uint8Array> { |
| 61 | if (size <= 0) return new Uint8Array() |
no test coverage detected