@zip.js/zip.js 2.8.59 → 2.8.60
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/deno.json +2 -2
- package/dist/zip-core-external.js +139 -19
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +115 -2
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +139 -19
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +5298 -3908
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +139 -19
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +117 -4
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +142 -19
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +117 -4
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +117 -4
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +142 -19
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +117 -4
- package/index-native.min.js +1 -1
- package/index.cjs +142 -19
- package/index.d.cts +134 -1
- package/index.d.ts +134 -1
- package/index.min.js +1 -1
- package/lib/core/codec-registry.js +5 -0
- package/lib/core/compression-methods.js +93 -0
- package/lib/core/streams/zip-entry-stream.js +7 -3
- package/lib/core/streams/zlib-wasm/zlib-streams.js +18 -8
- package/lib/core/version.js +31 -0
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-writer.js +1 -0
- package/lib/zip-core-base.js +7 -0
- package/lib/zip-fs-core.js +32 -0
- package/package.json +3 -3
- package/sync-versions.js +26 -0
package/sync-versions.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const JSON_VERSION_REGEXP = /("version"\s*:\s*")[^"]*(")/;
|
|
6
|
+
const LIB_VERSION_REGEXP = /(const VERSION = ")[^"]*(")/;
|
|
7
|
+
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const PACKAGE_PATH = path.resolve(__dirname, "package.json");
|
|
10
|
+
const DENO_PATH = path.resolve(__dirname, "deno.json");
|
|
11
|
+
const LIB_VERSION_PATH = path.resolve(__dirname, "lib", "core", "version.js");
|
|
12
|
+
|
|
13
|
+
const { version } = JSON.parse(fs.readFileSync(PACKAGE_PATH, "utf8"));
|
|
14
|
+
syncVersion(DENO_PATH, JSON_VERSION_REGEXP);
|
|
15
|
+
syncVersion(LIB_VERSION_PATH, LIB_VERSION_REGEXP);
|
|
16
|
+
|
|
17
|
+
function syncVersion(filePath, versionRegExp) {
|
|
18
|
+
const source = fs.readFileSync(filePath, "utf8");
|
|
19
|
+
if (!versionRegExp.test(source)) {
|
|
20
|
+
throw new Error("no version found in " + path.basename(filePath));
|
|
21
|
+
}
|
|
22
|
+
const syncedSource = source.replace(versionRegExp, "$1" + version + "$2");
|
|
23
|
+
if (syncedSource != source) {
|
|
24
|
+
fs.writeFileSync(filePath, syncedSource);
|
|
25
|
+
}
|
|
26
|
+
}
|