(abs: string)
| 2444 | } |
| 2445 | |
| 2446 | async function readSiblingOrder(abs: string): Promise<number> { |
| 2447 | try { |
| 2448 | const entries = await fs.readdir(path.dirname(abs), { withFileTypes: true }) |
| 2449 | const name = path.basename(abs) |
| 2450 | const index = entries.findIndex((entry) => entry.name === name) |
| 2451 | return index === -1 ? Number.MAX_SAFE_INTEGER : index |
| 2452 | } catch { |
| 2453 | return Number.MAX_SAFE_INTEGER |
| 2454 | } |
| 2455 | } |
| 2456 | |
| 2457 | async function mapLimit<T, U>( |
| 2458 | items: T[], |