MCPcopy Index your code
hub / github.com/nodejs/node / toPathStr

Function toPathStr

lib/internal/vfs/setup.js:31–36  ·  view source on GitHub ↗
(pathOrUrl)

Source from the content-addressed store, hash-verified

29});
30
31function toPathStr(pathOrUrl) {
32 if (typeof pathOrUrl === 'string') return pathOrUrl;
33 if (pathOrUrl instanceof URL) return fileURLToPath(pathOrUrl);
34 if (Buffer.isBuffer(pathOrUrl)) return pathOrUrl.toString();
35 return null;
36}
37
38function noopFdSync(fd) {
39 if (getVirtualFd(fd)) return true;

Callers 15

vfsReadFunction · 0.85
vfsOpFunction · 0.85
vfsOpVoidFunction · 0.85
existsSyncFunction · 0.85
readFileSyncFunction · 0.85
lstatSyncFunction · 0.85
accessSyncFunction · 0.85
readlinkSyncFunction · 0.85
statfsSyncFunction · 0.85
renameSyncFunction · 0.85
copyFileSyncFunction · 0.85
linkSyncFunction · 0.85

Calls 2

fileURLToPathFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…