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

Function vaultRelDir

apps/web/src/bridge/http-bridge.ts:773–777  ·  view source on GitHub ↗

Vault-relative directory for a (folder, subpath) — mirrors the server folderRoot.

(folder: NoteFolder, subpath: string, atRoot: boolean)

Source from the content-addressed store, hash-verified

771
772/** Vault-relative directory for a (folder, subpath) — mirrors the server folderRoot. */
773function vaultRelDir(folder: NoteFolder, subpath: string, atRoot: boolean): string {
774 const sub = (subpath ?? '').replace(/^\/+|\/+$/g, '')
775 if (folder === 'inbox') return atRoot ? sub : joinSub('inbox', sub)
776 return joinSub(folder, sub)
777}
778
779/** Split a vault-relative folder path into (folder, subpath) — inverse of vaultRelDir. */
780function splitVaultPath(rel: string, atRoot: boolean): { folder: NoteFolder; subpath: string } {

Callers 2

createDatabaseFunction · 0.85
listDatabasesFunction · 0.85

Calls 1

joinSubFunction · 0.85

Tested by

no test coverage detected