MCPcopy
hub / github.com/faressoft/terminalizer / isFile

Function isFile

utility.js:13–28  ·  view source on GitHub ↗

* Check if a path represents a valid path for a file * * @param {String} filePath an absolute or a relative path * @return {Boolean}

(filePath)

Source from the content-addressed store, hash-verified

11 * @return {Boolean}
12 */
13function 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

Callers 4

loadFileFunction · 0.85
getDefaultConfigFunction · 0.85
getTokenFunction · 0.85
removeTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected