MCPcopy Index your code
hub / github.com/nodejs/node / #toProviderPath

Method #toProviderPath

lib/internal/vfs/file_system.js:192–201  ·  view source on GitHub ↗

* Converts an absolute mounted path to a provider-relative POSIX path. * If not mounted, treats the path as already provider-relative. * @param {string} inputPath The path to convert * @returns {string}

(inputPath)

Source from the content-addressed store, hash-verified

190 * @returns {string}
191 */
192 #toProviderPath(inputPath) {
193 if (this[kMounted] && this[kMountPoint]) {
194 const resolved = isAbsolute(inputPath) ? inputPath : resolvePath(inputPath);
195 if (!isUnderMountPoint(resolved, this[kMountPoint])) {
196 throw createENOENT('open', inputPath);
197 }
198 return getRelativePath(resolved, this[kMountPoint]);
199 }
200 return pathPosix.normalize(inputPath);
201 }
202
203 /**
204 * Converts a provider-relative path back to a mounted path.

Callers 15

existsSyncMethod · 0.95
statSyncMethod · 0.95
lstatSyncMethod · 0.95
readFileSyncMethod · 0.95
writeFileSyncMethod · 0.95
appendFileSyncMethod · 0.95
readdirSyncMethod · 0.95
mkdirSyncMethod · 0.95
rmdirSyncMethod · 0.95
unlinkSyncMethod · 0.95
renameSyncMethod · 0.95
copyFileSyncMethod · 0.95

Calls 5

isAbsoluteFunction · 0.85
resolvePathFunction · 0.85
isUnderMountPointFunction · 0.85
createENOENTFunction · 0.85
getRelativePathFunction · 0.70

Tested by

no test coverage detected