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

Function listDatabaseLinkTargets

packages/app-core/src/lib/database-links.ts:34–48  ·  view source on GitHub ↗
(
  folders: FolderEntry[],
  vaultSettings: VaultSettings
)

Source from the content-addressed store, hash-verified

32 * excluded so deleted databases aren't offered as link targets.
33 */
34export function listDatabaseLinkTargets(
35 folders: FolderEntry[],
36 vaultSettings: VaultSettings
37): DatabaseLinkTarget[] {
38 const out: DatabaseLinkTarget[] = []
39 for (const folder of folders) {
40 if (folder.folder === 'trash') continue
41 if (!isFormDirName(folder.subpath)) continue
42 const csvPath = csvPathForFormDir(
43 vaultRelativeFolderPath(folder.folder, folder.subpath, vaultSettings)
44 )
45 out.push({ csvPath, title: formTitleFromCsvPath(csvPath) })
46 }
47 return out
48}
49
50/**
51 * Resolve a wikilink target to a database, by title (case-insensitive). Any

Callers 4

Preview.tsxFile · 0.90
openDatabaseFromWikilinkFunction · 0.90
wikilinkSourceFunction · 0.90

Calls 4

isFormDirNameFunction · 0.90
csvPathForFormDirFunction · 0.90
formTitleFromCsvPathFunction · 0.90
vaultRelativeFolderPathFunction · 0.70

Tested by

no test coverage detected