This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
+5 -6
View File
@@ -72,7 +72,7 @@ const mkdir = (dir, opt, cb) => {
};
exports.mkdir = mkdir;
const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
if (!parts.length) {
if (parts.length === 0) {
return cb(null, created);
}
const p = parts.shift();
@@ -83,8 +83,7 @@ const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
if (er) {
node_fs_1.default.lstat(part, (statEr, st) => {
if (statEr) {
statEr.path =
statEr.path && (0, normalize_windows_path_js_1.normalizeWindowsPath)(statEr.path);
statEr.path = statEr.path && (0, normalize_windows_path_js_1.normalizeWindowsPath)(statEr.path);
cb(statEr);
}
else if (st.isDirectory()) {
@@ -113,7 +112,7 @@ const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
};
const checkCwdSync = (dir) => {
let ok = false;
let code = undefined;
let code;
try {
ok = node_fs_1.default.statSync(dir).isDirectory();
}
@@ -159,14 +158,14 @@ const mkdirSync = (dir, opt) => {
}
const sub = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.relative(cwd, dir));
const parts = sub.split('/');
let created = undefined;
let created;
for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
part = (0, normalize_windows_path_js_1.normalizeWindowsPath)(node_path_1.default.resolve(part));
try {
node_fs_1.default.mkdirSync(part, mode);
created = created || part;
}
catch (er) {
catch {
const st = node_fs_1.default.lstatSync(part);
if (st.isDirectory()) {
continue;