/snap/node/11782/lib/node_modules/npm/node_modules/tar/dist/commonjs
NameSizeModeActions
create.js25740644editdlrm
cwd-error.js4360644editdlrm
extract.js34470644editdlrm
get-write-flag.js13040644editdlrm
header.js126380644editdlrm
index.js31370644editdlrm
index.min.js1012420644editdlrm
large-numbers.js27330644editdlrm
list.js54360644editdlrm
make-command.js20460644editdlrm
mkdir.js68020644editdlrm
mode-fix.js8760644editdlrm
normalize-unicode.js11590644editdlrm
normalize-windows-path.js6010644editdlrm
options.js21170644editdlrm
pack.js164260644editdlrm
package.json250644editdlrm
parse.js230370644editdlrm
path-reservations.js57150644editdlrm
pax.js49040644editdlrm
process-umask.js2730644editdlrm
read-entry.js44580644editdlrm
replace.js78730644editdlrm
strip-absolute-path.js12320644editdlrm
strip-trailing-slashes.js6510644editdlrm
symlink-error.js5280644editdlrm
types.js14760644editdlrm
unpack.js369290644editdlrm
update.js12290644editdlrm
warn-method.js9270644editdlrm
winchars.js7040644editdlrm
write-entry.js253700644editdlrm
Edit: /snap/node/11782/lib/node_modules/npm/node_modules/tar/dist/commonjs/strip-absolute-path.js (1232B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stripAbsolutePath = void 0; // unix absolute paths are also absolute on win32, so we use this for both const node_path_1 = require("node:path"); const { isAbsolute, parse } = node_path_1.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'] 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]; }; exports.stripAbsolutePath = stripAbsolutePath; //# sourceMappingURL=strip-absolute-path.js.map