(text: string)
| 20 | } |
| 21 | |
| 22 | function normalizeHeading(text: string): string { |
| 23 | return text |
| 24 | .replace(/[`*_~]/g, ' ') |
| 25 | .replace(/[^a-zA-Z0-9]+/g, ' ') |
| 26 | .trim() |
| 27 | .toLowerCase() |
| 28 | } |
| 29 | |
| 30 | async function fileExists(path: string): Promise<boolean> { |
| 31 | try { |