odf.js 5.1.0 → 5.1.2
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/dist/zip.cjs +6 -2
- package/dist/zip.js +6 -2
- package/package.json +2 -2
package/dist/zip.cjs
CHANGED
|
@@ -4,10 +4,14 @@ let fflate = require("fflate");
|
|
|
4
4
|
function unzipPackage(bytes) {
|
|
5
5
|
return (0, fflate.unzipSync)(bytes);
|
|
6
6
|
}
|
|
7
|
+
const FIXED_ENTRY_MTIME = new Date(Date.UTC(1980, 0, 1, 0, 0, 0));
|
|
7
8
|
function zipPackage(entries) {
|
|
8
9
|
const data = {};
|
|
9
|
-
for (const [path, entry] of entries) if (entry.stored === true) data[path] = [entry.bytes, {
|
|
10
|
-
|
|
10
|
+
for (const [path, entry] of entries) if (entry.stored === true) data[path] = [entry.bytes, {
|
|
11
|
+
level: 0,
|
|
12
|
+
mtime: FIXED_ENTRY_MTIME
|
|
13
|
+
}];
|
|
14
|
+
else data[path] = [entry.bytes, { mtime: FIXED_ENTRY_MTIME }];
|
|
11
15
|
return (0, fflate.zipSync)(data);
|
|
12
16
|
}
|
|
13
17
|
//#endregion
|
package/dist/zip.js
CHANGED
|
@@ -3,10 +3,14 @@ import { unzipSync, zipSync } from "fflate";
|
|
|
3
3
|
function unzipPackage(bytes) {
|
|
4
4
|
return unzipSync(bytes);
|
|
5
5
|
}
|
|
6
|
+
const FIXED_ENTRY_MTIME = new Date(Date.UTC(1980, 0, 1, 0, 0, 0));
|
|
6
7
|
function zipPackage(entries) {
|
|
7
8
|
const data = {};
|
|
8
|
-
for (const [path, entry] of entries) if (entry.stored === true) data[path] = [entry.bytes, {
|
|
9
|
-
|
|
9
|
+
for (const [path, entry] of entries) if (entry.stored === true) data[path] = [entry.bytes, {
|
|
10
|
+
level: 0,
|
|
11
|
+
mtime: FIXED_ENTRY_MTIME
|
|
12
|
+
}];
|
|
13
|
+
else data[path] = [entry.bytes, { mtime: FIXED_ENTRY_MTIME }];
|
|
10
14
|
return zipSync(data);
|
|
11
15
|
}
|
|
12
16
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "odf.js",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"description": "Type-safe, lossless round-trip conversion between OpenDocument Format packages (odt, ods, odp) and JSON, hand-written and dependency-minimal, built on Zod 4 codecs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"license": "MIT",
|
|
80
80
|
"packageManager": "pnpm@11.6.0",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"document-schema.js": "^4.
|
|
82
|
+
"document-schema.js": "^4.8.0",
|
|
83
83
|
"fast-xml-parser": "^5.10.1",
|
|
84
84
|
"fflate": "^0.8.3",
|
|
85
85
|
"zod": "^4.4.3"
|