* Check if a path represents a valid path for a file * * @param {String} filePath an absolute or a relative path * @return {Boolean}
(filePath)
| 11 | * @return {Boolean} |
| 12 | */ |
| 13 | function isFile(filePath) { |
| 14 | |
| 15 | // Resolve the path into an absolute path |
| 16 | filePath = di.path.resolve(filePath); |
| 17 | |
| 18 | try { |
| 19 | |
| 20 | return di.fs.statSync(filePath).isFile(); |
| 21 | |
| 22 | } catch (error) { |
| 23 | |
| 24 | return false; |
| 25 | |
| 26 | } |
| 27 | |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Check if a path represents a valid path for a directory |
no outgoing calls
no test coverage detected