(root: string, targetDir: string)
| 2889 | } |
| 2890 | |
| 2891 | function 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 | |
| 2901 | function cleanDeletedAssetPath(rel: string): string { |
| 2902 | const normalized = normalizeVaultRelativePath(rel) |
no test coverage detected