MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / folderForRelativePath

Function folderForRelativePath

apps/desktop/src/main/vault.ts:1175–1182  ·  view source on GitHub ↗
(rel: string)

Source from the content-addressed store, hash-verified

1173}
1174
1175export function folderForRelativePath(rel: string): NoteFolder | null {
1176 const normalized = normalizeVaultRelativePath(rel)
1177 const top = normalized.split('/')[0]
1178 if (SYSTEM_FOLDERS.has(top as NoteFolder)) return top as NoteFolder
1179 if (!top || top.startsWith('.')) return null
1180 if (RESERVED_ROOT_NAMES.has(top)) return null
1181 return 'inbox'
1182}
1183
1184/**
1185 * Ensure the expected vault folder layout exists and seed a welcome note

Callers 7

folderOfFunction · 0.90
handlerMethod · 0.90
dirHandlerMethod · 0.90
scanTasksForPathFunction · 0.90
folderOfFunction · 0.85
noteFolderFromRelPathFunction · 0.85
importExternalNoteFunction · 0.85

Calls 1

Tested by

no test coverage detected