(name: string)
| 2878 | } |
| 2879 | |
| 2880 | function cleanAssetFilename(name: string): string { |
| 2881 | const raw = name.trim() |
| 2882 | if (/[\\/]/.test(raw)) throw new Error('Use only a file name.') |
| 2883 | const trimmed = path.basename(raw) |
| 2884 | if (!trimmed || trimmed === '.' || trimmed === '..') throw new Error('Asset name is required.') |
| 2885 | if (path.extname(trimmed).toLowerCase() === '.md') { |
| 2886 | throw new Error('Use note actions for markdown notes.') |
| 2887 | } |
| 2888 | return trimmed |
| 2889 | } |
| 2890 | |
| 2891 | function cleanAssetTargetDir(root: string, targetDir: string): string { |
| 2892 | const normalized = normalizeVaultRelativePath(targetDir).replace(/^\/+|\/+$/g, '') |
no outgoing calls
no test coverage detected