MCPcopy Create free account
hub / github.com/chhoumann/quickadd / getTemplateFile

Function getTemplateFile

src/utils/templateFolderUtils.ts:33–39  ·  view source on GitHub ↗
(app: App, templatePath: string)

Source from the content-addressed store, hash-verified

31 * their own near-copy, and the preflight copy skipped the leading-slash strip).
32 */
33export 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

Callers 4

getTemplateContentFunction · 0.85
runTemplateHandlerFunction · 0.85
readTemplateFunction · 0.85

Calls 2

hasTemplateExtensionFunction · 0.85
getAbstractFileByPathMethod · 0.80

Tested by

no test coverage detected