(file: string)
| 158 | } |
| 159 | |
| 160 | function statSyncSafe(file: string): fs.Stats | undefined { |
| 161 | try { |
| 162 | return fs.statSync(file, { throwIfNoEntry: false }); |
| 163 | } catch { |
| 164 | // Although I can't repro on any OS, some users see ENOTDIR if the path |
| 165 | // looks like `/path/to/file.dart/foo` which is possible because of |
| 166 | // how we call some of the helpers. |
| 167 | return undefined; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | export function existsAndIsFileSync(file: string): boolean { |
| 172 | const stat = statSyncSafe(file); |
no outgoing calls
no test coverage detected