redzip 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +12 -1
- package/lib/local/index.js +16 -3
- package/lib/zip/write/index.js +3 -1
- package/package.json +2 -2
package/ChangeLog
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
2026.02.25, v4.3.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 9e9f975 redzip: keep mtime of directory (coderaiser/cloudcmd#457)
|
|
5
|
+
- 317f8cd redzip: c8 v11.0.0
|
|
6
|
+
|
|
7
|
+
2026.02.24, v4.2.0
|
|
8
|
+
|
|
9
|
+
feature:
|
|
10
|
+
- 2c7e9cc redzip: write: date: directory (coderaiser/cloudcmd#457)
|
|
11
|
+
|
|
1
12
|
2026.02.21, v4.1.0
|
|
2
13
|
|
|
3
14
|
feature:
|
|
4
|
-
- 7ccfd80 redzip: write: date: add (
|
|
15
|
+
- 7ccfd80 redzip: write: date: add (coderaiser/cloudcmd/#457)
|
|
5
16
|
- 72df84a redzip: redlint v6.1.1
|
|
6
17
|
- 5751676 redzip: putout v42.0.12
|
|
7
18
|
- 25589de redzip: madrun v13.0.0
|
package/lib/local/index.js
CHANGED
|
@@ -27,6 +27,13 @@ const winNotDir = (e) => e?.code === 'ENOENT';
|
|
|
27
27
|
|
|
28
28
|
const {assign} = Object;
|
|
29
29
|
|
|
30
|
+
const maybeSetDate = async (path, date) => {
|
|
31
|
+
if (!date)
|
|
32
|
+
return;
|
|
33
|
+
|
|
34
|
+
await tryToCatch(utimes, path, date, date);
|
|
35
|
+
};
|
|
36
|
+
|
|
30
37
|
export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
31
38
|
const {
|
|
32
39
|
unzip,
|
|
@@ -39,10 +46,14 @@ export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
|
39
46
|
recursive: true,
|
|
40
47
|
mode,
|
|
41
48
|
});
|
|
49
|
+
await maybeSetDate(outerPath, date);
|
|
50
|
+
|
|
42
51
|
return;
|
|
43
52
|
}
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
const dirPath = dirname(outerPath);
|
|
55
|
+
|
|
56
|
+
await mkdir(dirPath, {
|
|
46
57
|
recursive: true,
|
|
47
58
|
});
|
|
48
59
|
|
|
@@ -53,10 +64,12 @@ export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
|
53
64
|
if (unzip)
|
|
54
65
|
return await pipe([readStream, createGunzip(), writeStream]);
|
|
55
66
|
|
|
67
|
+
const {date: dirDate} = await readStat(dirPath);
|
|
68
|
+
|
|
56
69
|
await pipe([readStream, writeStream]);
|
|
57
70
|
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
await maybeSetDate(outerPath, date);
|
|
72
|
+
await maybeSetDate(dirPath, dirDate);
|
|
60
73
|
};
|
|
61
74
|
|
|
62
75
|
export const readSize = async (outerPath, innerPath, options) => {
|
package/lib/zip/write/index.js
CHANGED
|
@@ -74,7 +74,9 @@ async function update(outerPath, innerPath, stream, zipfile, {remove, date}) {
|
|
|
74
74
|
zipfile.addReadStream(stream, shortPath);
|
|
75
75
|
|
|
76
76
|
if (!remove && !stream)
|
|
77
|
-
zipfile.addEmptyDirectory(shortPath
|
|
77
|
+
zipfile.addEmptyDirectory(shortPath, {
|
|
78
|
+
mtime: date,
|
|
79
|
+
});
|
|
78
80
|
|
|
79
81
|
let count = 0;
|
|
80
82
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redzip",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/redzip.js",
|
|
6
6
|
"description": "work with files inside archives like with regular files",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@iocmd/wait": "^2.1.0",
|
|
43
|
-
"c8": "^
|
|
43
|
+
"c8": "^11.0.0",
|
|
44
44
|
"eslint": "^10.0.1",
|
|
45
45
|
"eslint-plugin-putout": "^31.0.1",
|
|
46
46
|
"madrun": "^13.0.0",
|