MCPcopy
hub / github.com/patriksimek/vm2 / pathTestIsFile

Function pathTestIsFile

lib/resolver.js:166–173  ·  view source on GitHub ↗
(fs, path)

Source from the content-addressed store, hash-verified

164}
165
166function pathTestIsFile(fs, path) {
167 try {
168 const stat = fs.statSync(path, {__proto__: null, throwIfNoEntry: false});
169 return stat && stat.isFile();
170 } catch (e) {
171 return false;
172 }
173}
174
175function readFile(fs, path) {
176 return fs.readFileSync(path, {encoding: 'utf8'});

Callers 2

readFileWhenExistsFunction · 0.85
tryFileMethod · 0.85

Calls 1

statSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…