* 从安全文件名恢复原始路径(需要配合映射文件) * @param safeFileName 安全文件名 * @returns 恢复的原始路径(近似)
(safeFileName: string)
| 21 | * @returns 恢复的原始路径(近似) |
| 22 | */ |
| 23 | static fromSafeFileName(safeFileName: string): string { |
| 24 | // 移除 .json 后缀并将下划线转回空格 |
| 25 | // 注意:这是近似恢复,无法完全还原特殊字符 |
| 26 | return safeFileName |
| 27 | .replace(/\.json$/, '') |
| 28 | .replace(/_/g, ' '); |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * 生成文件路径的哈希值(备用方案) |
no test coverage detected