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

Function preprocessSymlinkDestination

lib/internal/fs/utils.js:367–385  ·  view source on GitHub ↗
(path, type, linkPath)

Source from the content-addressed store, hash-verified

365}
366
367function preprocessSymlinkDestination(path, type, linkPath) {
368 if (!isWindows) {
369 // No preprocessing is needed on Unix.
370 return path;
371 }
372 path = '' + path;
373 if (type === 'junction') {
374 // Junctions paths need to be absolute and \\?\-prefixed.
375 // A relative target is relative to the link's parent directory.
376 path = pathModule.resolve(linkPath, '..', path);
377 return pathModule.toNamespacedPath(path);
378 }
379 if (pathModule.isAbsolute(path)) {
380 // If the path is absolute, use the \\?\-prefix to enable long filenames
381 return pathModule.toNamespacedPath(path);
382 }
383 // Windows symlinks don't tolerate forward slashes.
384 return RegExpPrototypeSymbolReplace(/\//g, path, '\\');
385}
386
387// Constructor for file stats.
388function StatsBase(dev, mode, nlink, uid, gid, rdev, blksize,

Callers 3

symlinkFunction · 0.85
symlinkSyncFunction · 0.85
symlinkFunction · 0.85

Calls 1

resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…