/snap/node/11782/lib/node_modules/npm/node_modules/tar/dist/esm
NameSizeModeActions
create.js21630644editdlrm
cwd-error.js3100644editdlrm
extract.js16920644editdlrm
get-write-flag.js10180644editdlrm
header.js110960644editdlrm
index.js6470644editdlrm
index.min.js829670644editdlrm
large-numbers.js25810644editdlrm
list.js34440644editdlrm
make-command.js18700644editdlrm
mkdir.js57390644editdlrm
mode-fix.js7530644editdlrm
normalize-unicode.js10090644editdlrm
normalize-windows-path.js4900644editdlrm
options.js16390644editdlrm
pack.js144020644editdlrm
package.json230644editdlrm
parse.js227970644editdlrm
path-reservations.js54470644editdlrm
pax.js47540644editdlrm
process-umask.js1560644editdlrm
read-entry.js41750644editdlrm
replace.js72030644editdlrm
strip-absolute-path.js10600644editdlrm
strip-trailing-slashes.js4890644editdlrm
symlink-error.js3900644editdlrm
types.js12770644editdlrm
unpack.js336090644editdlrm
update.js10060644editdlrm
warn-method.js7950644editdlrm
winchars.js5490644editdlrm
write-entry.js227810644editdlrm
Edit: /snap/node/11782/lib/node_modules/npm/node_modules/tar/dist/esm/strip-absolute-path.js (1060B)
// unix absolute paths are also absolute on win32, so we use this for both import { win32 } from 'node:path'; const { isAbsolute, parse } = 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'] export const stripAbsolutePath = (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]; }; //# sourceMappingURL=strip-absolute-path.js.map