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

Function localAssetTargetKind

apps/desktop/src/main/vault.ts:1494–1504  ·  view source on GitHub ↗
(target: string)

Source from the content-addressed store, hash-verified

1492}
1493
1494function localAssetTargetKind(target: string): ImportedAssetKind | null {
1495 const clean = target.split('#')[0]?.split('?')[0] ?? target
1496 const lastDot = clean.lastIndexOf('.')
1497 if (lastDot === -1) return null
1498 const ext = clean.slice(lastDot).toLowerCase()
1499 if (IMAGE_EXTENSIONS.has(ext)) return 'image'
1500 if (PDF_EXTENSIONS.has(ext)) return 'pdf'
1501 if (AUDIO_EXTENSIONS.has(ext)) return 'audio'
1502 if (VIDEO_EXTENSIONS.has(ext)) return 'video'
1503 return 'file'
1504}
1505
1506/** Pull unique `#tags` out of markdown text, ignoring fenced/inline code. */
1507function extractTags(body: string): string[] {

Callers 3

bodyHasLocalAssetFunction · 0.70
extractWikilinksFunction · 0.70
extractAssetEmbedsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected