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

Function folderOf

apps/desktop/src/main/watcher.ts:17–23  ·  view source on GitHub ↗
(root: string, abs: string)

Source from the content-addressed store, hash-verified

15}
16
17function folderOf(root: string, abs: string): NoteFolder | null {
18 const rel = toPosix(path.relative(root, abs))
19 const folder = folderForRelativePath(rel)
20 if (folder) return folder
21 const top = rel.split('/')[0]
22 return ATTACHMENTS_DIRS.has(top) ? 'inbox' : null
23}
24
25function relativeVaultPath(root: string, abs: string): string {
26 return toPosix(path.relative(root, abs))

Callers 1

handlerMethod · 0.70

Calls 2

folderForRelativePathFunction · 0.90
toPosixFunction · 0.70

Tested by

no test coverage detected