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

Function FolderForRelativePath

apps/server/internal/vault/types.go:43–56  ·  view source on GitHub ↗
(rel string)

Source from the content-addressed store, hash-verified

41var AllFolders = []NoteFolder{FolderInbox, FolderQuick, FolderArchive, FolderTrash}
42
43func FolderForRelativePath(rel string) (NoteFolder, bool) {
44 normalized := filepath.ToSlash(rel)
45 top := strings.SplitN(normalized, "/", 2)[0]
46 if IsValidFolder(NoteFolder(top)) {
47 return NoteFolder(top), true
48 }
49 if top == "" || strings.HasPrefix(top, ".") {
50 return "", false
51 }
52 if _, reserved := reservedRootNames[top]; reserved {
53 return "", false
54 }
55 return FolderInbox, true
56}
57
58type DateNotePatternSettings struct {
59 Directory string `json:"directory"`

Callers 1

folderOfMethod · 0.85

Calls 2

IsValidFolderFunction · 0.85
NoteFolderTypeAlias · 0.85

Tested by

no test coverage detected