(text: string)
| 232 | } |
| 233 | |
| 234 | function normalizeTextForFile(text: string): string { |
| 235 | return (text || "未知").replace(/[\u200B-\u200D\uFEFF]/g, "").replace(/\s+/g, " ").trim() |
| 236 | .replace(/[–—‐‑‒⁃−➖﹘﹣]/g, "-").replace(/^[-_\s]+|[-_\s]+$/g, "") |
| 237 | .replace(/[\\/\?%\*:|"<>]/g, "_").replace(/[ _]{2,}/g, " ") |
| 238 | .slice(0, 120).replace(/[ .]+$/g, "") || "未知"; |
| 239 | } |
| 240 | |
| 241 | function buildNormalizedFileName(artist: string, title: string): string { |
| 242 | return `${normalizeTextForFile(title)} - ${normalizeTextForFile(artist)}`; |
no outgoing calls
no test coverage detected