( filePath: string, cutoffDate: Date, fsImpl: FsOperations, )
| 132 | } |
| 133 | |
| 134 | async function unlinkIfOld( |
| 135 | filePath: string, |
| 136 | cutoffDate: Date, |
| 137 | fsImpl: FsOperations, |
| 138 | ): Promise<boolean> { |
| 139 | const stats = await fsImpl.stat(filePath) |
| 140 | if (stats.mtime < cutoffDate) { |
| 141 | await fsImpl.unlink(filePath) |
| 142 | return true |
| 143 | } |
| 144 | return false |
| 145 | } |
| 146 | |
| 147 | async function tryRmdir(dirPath: string, fsImpl: FsOperations): Promise<void> { |
| 148 | try { |
no outgoing calls
no test coverage detected