MCPcopy
hub / github.com/callumalpass/tasknotes / getTypesFolder

Method getTypesFolder

src/services/MdbaseSpecService.ts:78–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 private async getTypesFolder(): Promise<string> {
79 const vault = this.plugin.app.vault;
80 const mdbaseExists = await vault.adapter.exists("mdbase.yaml");
81 if (!mdbaseExists) {
82 return DEFAULT_TYPES_FOLDER;
83 }
84
85 try {
86 const content = await vault.adapter.read("mdbase.yaml");
87 const parsed = YAML.parse(content) as MdbaseYamlConfig | null;
88 return (
89 this.normalizeTypesFolder(parsed?.settings?.types_folder) ?? DEFAULT_TYPES_FOLDER
90 );
91 } catch (error) {
92 tasknotesLogger.warn("[TaskNotes][mdbase-spec] Failed to read mdbase.yaml:", {
93 category: "configuration",
94 operation: "read-mdbase-yaml",
95 error: error,
96 });
97 return DEFAULT_TYPES_FOLDER;
98 }
99 }
100
101 private normalizeTypesFolder(value: unknown): string | null {
102 if (typeof value !== "string") {

Callers 1

generateMethod · 0.95

Calls 5

normalizeTypesFolderMethod · 0.95
existsMethod · 0.80
parseMethod · 0.80
warnMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected