(targetPath: string, goback: number = 0)
| 34 | } |
| 35 | |
| 36 | function relativePath(targetPath: string, goback: number = 0): string { |
| 37 | const levels = Array(Math.max(0, goback - 1)).fill('..'); |
| 38 | return path.resolve(process.cwd(), ...levels, targetPath.trim()); |
| 39 | } |
| 40 | |
| 41 | function createDirectoryIfNotExists(passedPath: string): void { |
| 42 | const dirPath = relativePath(passedPath, 0); |
no outgoing calls
no test coverage detected