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

Function cleanDeletedAssetPath

apps/desktop/src/main/vault.ts:2901–2911  ·  view source on GitHub ↗
(rel: string)

Source from the content-addressed store, hash-verified

2899}
2900
2901function cleanDeletedAssetPath(rel: string): string {
2902 const normalized = normalizeVaultRelativePath(rel)
2903 if (!normalized) throw new Error('Deleted asset path is required.')
2904 if (normalized.split('/').includes(INTERNAL_VAULT_DIR)) {
2905 throw new Error('Cannot restore internal ZenNotes files.')
2906 }
2907 if (path.extname(normalized).toLowerCase() === '.md') {
2908 throw new Error('Use note actions to restore markdown notes.')
2909 }
2910 return normalized
2911}
2912
2913function cleanDeletedAssetToken(token: string): string {
2914 if (!/^[0-9a-f-]{36}$/i.test(token)) {

Callers 1

restoreDeletedAssetFunction · 0.85

Calls 1

Tested by

no test coverage detected