(target: string, newName: string)
| 302 | } |
| 303 | |
| 304 | rename(target: string, newName: string) { |
| 305 | if (!this.check(target)) throw new Error(ERROR_MSG_01); |
| 306 | if (!this.checkPath(newName)) throw new Error(ERROR_MSG_01); |
| 307 | const targetPath = this.toAbsolutePath(target); |
| 308 | const newPath = this.toAbsolutePath(newName); |
| 309 | fs.renameSync(targetPath, newPath); |
| 310 | } |
| 311 | |
| 312 | public static checkFileName(fileName?: string): boolean { |
| 313 | if (!fileName) return false; |
no test coverage detected