| 1 | import { listTree } from '../tree/list-tree.js'; |
| 2 | |
| 3 | const CANDIDATES = [ |
| 4 | 'readme.md', |
| 5 | 'readme.markdown', |
| 6 | 'readme.mdown', |
| 7 | 'readme.rst', |
| 8 | 'readme.txt', |
| 9 | 'readme', |
| 10 | ]; |
| 11 | |
| 12 | export async function findReadmePath |
| 13 | gitDir, |
| 14 | ref, |
| 15 | prefix = '', |
| 16 | }: { |
| 17 | gitDir: string |
| 18 | ref: string |
| 19 | /** Trailing-slash directory prefix, as `normalizeTreePath` produces. */ |
| 20 | prefix?: string |
| 21 | }): Promise<string |
| 22 | const entries = |
| 23 | |
| 24 | const byName = |
| 25 | entries |
| 26 | .filter((entry) |
| 27 | .map((entry) |
| 28 | ); |
| 29 | |
| 30 | for (const candidate |
| 31 | const path = |
| 32 | if (path) return |
| 33 | } |
| 34 | |
| 35 | return null; |
| 36 | } |