/opt/alt/alt-nodejs24/root/usr/lib/node_modules/npm/node_modules.bundled/tar/lib
// unix absolute paths are also absolute on win32, so we use this for both const { isAbsolute, parse } = require('path').win32 // returns [root, stripped] // Note that windows will think that //x/y/z/a has a "root" of //x/y, and in // those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip / // explicitly if it's the first character. // drive-specific relative paths on Windows get their root stripped off even // though they are not absolute, so `c:../foo` becomes ['c:', '../foo'] module.exports = path => { let r = '' let parsed = parse(path) while (isAbsolute(path) || parsed.root) { // windows will think that //x/y/z has a "root" of //x/y/ // but strip the //?/C:/ off of //?/C:/path const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ? '/' : parsed.root path = path.slice(root.length) r += root parsed = parse(path) } return [r, path] }
.
Edit
..
Edit
create.js
Edit
extract.js
Edit
get-write-flag.js
Edit
header.js
Edit
high-level-opt.js
Edit
large-numbers.js
Edit
list.js
Edit
mkdir.js
Edit
mode-fix.js
Edit
normalize-unicode.js
Edit
normalize-windows-path.js
Edit
pack.js
Edit
parse.js
Edit
path-reservations.js
Edit
pax.js
Edit
read-entry.js
Edit
replace.js
Edit
strip-absolute-path.js
Edit
strip-trailing-slashes.js
Edit
types.js
Edit
unpack.js
Edit
update.js
Edit
warn-mixin.js
Edit
winchars.js
Edit
write-entry.js
Edit