(filename: string)
| 567 | } |
| 568 | |
| 569 | export function isFileReadable(filename: string): boolean { |
| 570 | if (!tryStatSync(filename)) { |
| 571 | return false |
| 572 | } |
| 573 | |
| 574 | try { |
| 575 | // Check if current process has read permission to the file |
| 576 | fs.accessSync(filename, fs.constants.R_OK) |
| 577 | |
| 578 | return true |
| 579 | } catch { |
| 580 | return false |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | const splitFirstDirRE = /(.+?)[\\/](.+)/ |
| 585 |
no test coverage detected