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
+12 -13
View File
@@ -122,8 +122,7 @@ class WriteEntry extends minipass_1.Minipass {
this.noPax = !!opt.noPax;
this.noMtime = !!opt.noMtime;
this.mtime = opt.mtime;
this.prefix =
opt.prefix ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.prefix) : undefined;
this.prefix = opt.prefix ? (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.prefix) : undefined;
this.onWriteEntry = opt.onWriteEntry;
if (typeof opt.onwarn === 'function') {
this.on('warn', opt.onwarn);
@@ -140,8 +139,8 @@ class WriteEntry extends minipass_1.Minipass {
if (this.win32) {
// force the \ to / normalization, since we might not *actually*
// be on windows, but want \ to be considered a path separator.
this.path = winchars.decode(this.path.replace(/\\/g, '/'));
p = p.replace(/\\/g, '/');
this.path = winchars.decode(this.path.replaceAll(/\\/g, '/'));
p = p.replaceAll(/\\/g, '/');
}
this.absolute = (0, normalize_windows_path_js_1.normalizeWindowsPath)(opt.absolute || path_1.default.resolve(this.cwd, p));
if (this.path === '') {
@@ -243,7 +242,7 @@ class WriteEntry extends minipass_1.Minipass {
atime: this.portable ? undefined : this.header.atime,
ctime: this.portable ? undefined : this.header.ctime,
gid: this.portable ? undefined : this.header.gid,
mtime: this.noMtime ? undefined : (this.mtime || this.header.mtime),
mtime: this.noMtime ? undefined : this.mtime || this.header.mtime,
path: this[PREFIX](this.path),
linkpath: this.type === 'Link' && this.linkpath !== undefined ?
this[PREFIX](this.linkpath)
@@ -446,7 +445,7 @@ class WriteEntry extends minipass_1.Minipass {
if (this.blockRemain) {
super.write(Buffer.alloc(this.blockRemain));
}
return this[CLOSE](er => er ? this.emit('error', er) : this.end());
return this[CLOSE](er => (er ? this.emit('error', er) : this.end()));
}
/* c8 ignore start */
if (!this.buf) {
@@ -495,7 +494,7 @@ class WriteEntrySync extends WriteEntry {
try {
this[CLOSE](() => { });
}
catch (er) { }
catch { }
}
}
}
@@ -565,16 +564,13 @@ class WriteEntryTar extends minipass_1.Minipass {
this.prefix = opt.prefix;
this.path = (0, normalize_windows_path_js_1.normalizeWindowsPath)(readEntry.path);
this.mode =
readEntry.mode !== undefined ?
this[MODE](readEntry.mode)
: undefined;
readEntry.mode !== undefined ? this[MODE](readEntry.mode) : undefined;
this.uid = this.portable ? undefined : readEntry.uid;
this.gid = this.portable ? undefined : readEntry.gid;
this.uname = this.portable ? undefined : readEntry.uname;
this.gname = this.portable ? undefined : readEntry.gname;
this.size = readEntry.size;
this.mtime =
this.noMtime ? undefined : opt.mtime || readEntry.mtime;
this.mtime = this.noMtime ? undefined : opt.mtime || readEntry.mtime;
this.atime = this.portable ? undefined : readEntry.atime;
this.ctime = this.portable ? undefined : readEntry.ctime;
this.linkpath =
@@ -686,7 +682,10 @@ class WriteEntryTar extends minipass_1.Minipass {
}
if (cb)
this.once('finish', cb);
chunk ? super.end(chunk, cb) : super.end(cb);
if (chunk)
super.end(chunk, cb);
else
super.end(cb);
/* c8 ignore stop */
return this;
}