/usr/lib/node_modules/pnpm/dist/node_modules/tar/dist/esm
NameSizeModeActions
create.d.ts.map1920644editdlrm
create.js21630644editdlrm
create.js.map53290644editdlrm
cwd-error.d.ts.map2830644editdlrm
cwd-error.js3100644editdlrm
cwd-error.js.map7270644editdlrm
extract.d.ts.map1940644editdlrm
extract.js16920644editdlrm
extract.js.map36340644editdlrm
get-write-flag.d.ts.map1680644editdlrm
get-write-flag.js10180644editdlrm
get-write-flag.js.map19310644editdlrm
header.d.ts.map18300644editdlrm
header.js106040644editdlrm
header.js.map241970644editdlrm
index.d.ts.map8270644editdlrm
index.js6470644editdlrm
index.js.map16310644editdlrm
large-numbers.d.ts.map2170644editdlrm
large-numbers.js25810644editdlrm
large-numbers.js.map59030644editdlrm
list.d.ts.map2870644editdlrm
list.js32340644editdlrm
list.js.map70980644editdlrm
make-command.d.ts.map44070644editdlrm
make-command.js18700644editdlrm
make-command.js.map90750644editdlrm
mkdir.d.ts.map8000644editdlrm
mkdir.js64520644editdlrm
mkdir.js.map151560644editdlrm
mode-fix.d.ts.map1740644editdlrm
mode-fix.js7530644editdlrm
mode-fix.js.map13930644editdlrm
normalize-unicode.d.ts.map1730644editdlrm
normalize-unicode.js4890644editdlrm
normalize-unicode.js.map10040644editdlrm
normalize-windows-path.d.ts.map1840644editdlrm
normalize-windows-path.js4900644editdlrm
normalize-windows-path.js.map9500644editdlrm
options.d.ts.map58320644editdlrm
options.js16390644editdlrm
options.js.map263980644editdlrm
pack.d.ts.map37950644editdlrm
pack.js130050644editdlrm
pack.js.map281820644editdlrm
package.json230644editdlrm
parse.d.ts.map37050644editdlrm
parse.js217410644editdlrm
parse.js.map401290644editdlrm
path-reservations.d.ts.map4190644editdlrm
path-reservations.js54610644editdlrm
path-reservations.js.map109440644editdlrm
pax.d.ts.map8820644editdlrm
pax.js47540644editdlrm
pax.js.map100850644editdlrm
read-entry.d.ts.map11800644editdlrm
read-entry.js41750644editdlrm
read-entry.js.map81880644editdlrm
replace.d.ts.map1440644editdlrm
replace.js71850644editdlrm
replace.js.map152580644editdlrm
strip-absolute-path.d.ts.map1780644editdlrm
strip-absolute-path.js10600644editdlrm
strip-absolute-path.js.map19230644editdlrm
strip-trailing-slashes.d.ts.map1830644editdlrm
strip-trailing-slashes.js4890644editdlrm
strip-trailing-slashes.js.map10560644editdlrm
symlink-error.d.ts.map3210644editdlrm
symlink-error.js3900644editdlrm
symlink-error.js.map8370644editdlrm
types.d.ts.map7670644editdlrm
types.js12770644editdlrm
types.js.map35020644editdlrm
unpack.d.ts.map39850644editdlrm
unpack.js324450644editdlrm
unpack.js.map620810644editdlrm
update.d.ts.map1400644editdlrm
update.js10060644editdlrm
update.js.map23240644editdlrm
warn-method.d.ts.map11110644editdlrm
warn-method.js7950644editdlrm
warn-method.js.map25930644editdlrm
winchars.d.ts.map1950644editdlrm
winchars.js5490644editdlrm
winchars.js.map16420644editdlrm
write-entry.d.ts.map48330644editdlrm
write-entry.js227810644editdlrm
write-entry.js.map483860644editdlrm
Edit: /usr/lib/node_modules/pnpm/dist/node_modules/tar/dist/esm/mkdir.js (6452B)
import { chownr, chownrSync } from 'chownr'; import fs from 'fs'; import { mkdirp, mkdirpSync } from 'mkdirp'; import path from 'node:path'; import { CwdError } from './cwd-error.js'; import { normalizeWindowsPath } from './normalize-windows-path.js'; import { SymlinkError } from './symlink-error.js'; const cGet = (cache, key) => cache.get(normalizeWindowsPath(key)); const cSet = (cache, key, val) => cache.set(normalizeWindowsPath(key), val); const checkCwd = (dir, cb) => { fs.stat(dir, (er, st) => { if (er || !st.isDirectory()) { er = new CwdError(dir, er?.code || 'ENOTDIR'); } cb(er); }); }; /** * Wrapper around mkdirp for tar's needs. * * The main purpose is to avoid creating directories if we know that * they already exist (and track which ones exist for this purpose), * and prevent entries from being extracted into symlinked folders, * if `preservePaths` is not set. */ export const mkdir = (dir, opt, cb) => { dir = normalizeWindowsPath(dir); // if there's any overlap between mask and mode, // then we'll need an explicit chmod /* c8 ignore next */ const umask = opt.umask ?? 0o22; const mode = opt.mode | 0o0700; const needChmod = (mode & umask) !== 0; const uid = opt.uid; const gid = opt.gid; const doChown = typeof uid === 'number' && typeof gid === 'number' && (uid !== opt.processUid || gid !== opt.processGid); const preserve = opt.preserve; const unlink = opt.unlink; const cache = opt.cache; const cwd = normalizeWindowsPath(opt.cwd); const done = (er, created) => { if (er) { cb(er); } else { cSet(cache, dir, true); if (created && doChown) { chownr(created, uid, gid, er => done(er)); } else if (needChmod) { fs.chmod(dir, mode, cb); } else { cb(); } } }; if (cache && cGet(cache, dir) === true) { return done(); } if (dir === cwd) { return checkCwd(dir, done); } if (preserve) { return mkdirp(dir, { mode }).then(made => done(null, made ?? undefined), // oh, ts done); } const sub = normalizeWindowsPath(path.relative(cwd, dir)); const parts = sub.split('/'); mkdir_(cwd, parts, mode, cache, unlink, cwd, undefined, done); }; const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => { if (!parts.length) { return cb(null, created); } const p = parts.shift(); const part = normalizeWindowsPath(path.resolve(base + '/' + p)); if (cGet(cache, part)) { return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb); } fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)); }; const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => (er) => { if (er) { fs.lstat(part, (statEr, st) => { if (statEr) { statEr.path = statEr.path && normalizeWindowsPath(statEr.path); cb(statEr); } else if (st.isDirectory()) { mkdir_(part, parts, mode, cache, unlink, cwd, created, cb); } else if (unlink) { fs.unlink(part, er => { if (er) { return cb(er); } fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)); }); } else if (st.isSymbolicLink()) { return cb(new SymlinkError(part, part + '/' + parts.join('/'))); } else { cb(er); } }); } else { created = created || part; mkdir_(part, parts, mode, cache, unlink, cwd, created, cb); } }; const checkCwdSync = (dir) => { let ok = false; let code = undefined; try { ok = fs.statSync(dir).isDirectory(); } catch (er) { code = er?.code; } finally { if (!ok) { throw new CwdError(dir, code ?? 'ENOTDIR'); } } }; export const mkdirSync = (dir, opt) => { dir = normalizeWindowsPath(dir); // if there's any overlap between mask and mode, // then we'll need an explicit chmod /* c8 ignore next */ const umask = opt.umask ?? 0o22; const mode = opt.mode | 0o700; const needChmod = (mode & umask) !== 0; const uid = opt.uid; const gid = opt.gid; const doChown = typeof uid === 'number' && typeof gid === 'number' && (uid !== opt.processUid || gid !== opt.processGid); const preserve = opt.preserve; const unlink = opt.unlink; const cache = opt.cache; const cwd = normalizeWindowsPath(opt.cwd); const done = (created) => { cSet(cache, dir, true); if (created && doChown) { chownrSync(created, uid, gid); } if (needChmod) { fs.chmodSync(dir, mode); } }; if (cache && cGet(cache, dir) === true) { return done(); } if (dir === cwd) { checkCwdSync(cwd); return done(); } if (preserve) { return done(mkdirpSync(dir, mode) ?? undefined); } const sub = normalizeWindowsPath(path.relative(cwd, dir)); const parts = sub.split('/'); let created = undefined; for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) { part = normalizeWindowsPath(path.resolve(part)); if (cGet(cache, part)) { continue; } try { fs.mkdirSync(part, mode); created = created || part; cSet(cache, part, true); } catch (er) { const st = fs.lstatSync(part); if (st.isDirectory()) { cSet(cache, part, true); continue; } else if (unlink) { fs.unlinkSync(part); fs.mkdirSync(part, mode); created = created || part; cSet(cache, part, true); continue; } else if (st.isSymbolicLink()) { return new SymlinkError(part, part + '/' + parts.join('/')); } } } return done(created); }; //# sourceMappingURL=mkdir.js.map