MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / statSyncSafe

Function statSyncSafe

src/util.ts:676–682  ·  view source on GitHub ↗
(path: fs.PathLike)

Source from the content-addressed store, hash-verified

674}
675
676export function statSyncSafe(path: fs.PathLike): fs.Stats | undefined {
677 try {
678 return fs.statSync(path, { throwIfNoEntry: false });
679 } catch (e) {
680 return undefined;
681 }
682}
683
684export function isDirSafe(path: fs.PathLike): boolean {
685 return !!statSyncSafe(path)?.isDirectory();

Callers 2

isDirSafeFunction · 0.85
isFileSafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected