(fileName: string)
| 219 | } |
| 220 | |
| 221 | async newFile(fileName: string) { |
| 222 | // if (!FileManager.checkFileName(fileName)) throw new Error(ERROR_MSG_01); |
| 223 | if (!this.checkPath(fileName)) throw new Error(ERROR_MSG_01); |
| 224 | const target = this.toAbsolutePath(fileName); |
| 225 | const parentDir = path.resolve(path.dirname(target)); |
| 226 | if (parentDir !== path.parse(parentDir).root) await fs.mkdir(parentDir, { recursive: true }); |
| 227 | return await fs.createFile(target); |
| 228 | } |
| 229 | |
| 230 | async copy(target1: string, target2: string) { |
| 231 | if (!this.checkPath(target2) || !this.check(target1)) throw new Error(ERROR_MSG_01); |
no test coverage detected