(app: App, templatePath: string)
| 31 | * their own near-copy, and the preflight copy skipped the leading-slash strip). |
| 32 | */ |
| 33 | export function getTemplateFile(app: App, templatePath: string): TFile | null { |
| 34 | const stripped = templatePath.trim().replace(/^\/+/, ""); |
| 35 | if (!stripped) return null; |
| 36 | const resolved = hasTemplateExtension(stripped) ? stripped : `${stripped}.md`; |
| 37 | const file = app.vault.getAbstractFileByPath(resolved); |
| 38 | return file instanceof TFile ? file : null; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Canonical, order-preserving normalization for the configured template folder |
no test coverage detected