(root: string, abs: string)
| 337 | } |
| 338 | |
| 339 | function folderOf(root: string, abs: string): NoteFolder | null { |
| 340 | const rel = toPosix(path.relative(root, abs)) |
| 341 | if (!rel || rel.startsWith('..')) return null |
| 342 | const top = rel.split('/')[0] |
| 343 | if (FOLDERS.includes(top as NoteFolder)) return top as NoteFolder |
| 344 | // Root-level files belong to inbox in `primaryNotesLocation: 'root'` |
| 345 | // mode. Hidden names (.zennotes, attachments, system folders) are |
| 346 | // not notes — return null so they're rejected. |
| 347 | if (!top || top.startsWith('.') || HIDDEN_PRIMARY_ROOT_NAMES.has(top)) return null |
| 348 | return 'inbox' |
| 349 | } |
| 350 | |
| 351 | /* ---------- Markdown parsing ----------------------------------------- */ |
| 352 |
no test coverage detected