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

Function cleanAssetTargetDir

apps/desktop/src/main/vault.ts:2891–2899  ·  view source on GitHub ↗
(root: string, targetDir: string)

Source from the content-addressed store, hash-verified

2889}
2890
2891function cleanAssetTargetDir(root: string, targetDir: string): string {
2892 const normalized = normalizeVaultRelativePath(targetDir).replace(/^\/+|\/+$/g, '')
2893 // No explicit target → the unified `assets/` folder (not loose at the root).
2894 if (!normalized) return resolveSafe(root, ASSETS_DIR)
2895 if (normalized.split('/').includes(INTERNAL_VAULT_DIR)) {
2896 throw new Error('Cannot move assets into internal ZenNotes files.')
2897 }
2898 return resolveSafe(root, normalized)
2899}
2900
2901function cleanDeletedAssetPath(rel: string): string {
2902 const normalized = normalizeVaultRelativePath(rel)

Callers 1

moveAssetFunction · 0.85

Calls 2

resolveSafeFunction · 0.70

Tested by

no test coverage detected