nitro-patcher 1.1.1 → 1.2.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/README.md +4 -2
- package/dist/browser.js +7 -2
- package/dist/browser.js.map +2 -2
- package/dist/{chunk-2F24YQ5P.js → chunk-PALHUY7B.js} +8 -3
- package/dist/chunk-PALHUY7B.js.map +1 -0
- package/dist/cli.js +39 -16
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/nitro-helper.d.ts +1 -1
- package/dist/nitro-patch-helper.js +1 -1
- package/package.json +1 -1
- package/src/cli.ts +54 -16
- package/src/patch/create.ts +7 -2
- package/dist/chunk-2F24YQ5P.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,15 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
12
|
pnpm add nitro-patcher
|
|
13
|
-
npx nitro-patcher original.nds patch.
|
|
13
|
+
npx nitro-patcher --input original.nds --patch patch.xzp --output patched.nds
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
也可以直接运行:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
npx nitro-patcher --json original.nds patch.
|
|
19
|
+
npx nitro-patcher --json --input original.nds --patch patch.xzp --output patched.nds
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
完整说明见 [Wiki](https://github.com/Xzonn/nitro-patcher/wiki)。
|
|
23
|
+
|
|
22
24
|
## License
|
|
23
25
|
|
|
24
26
|
GPL v3,见 [LICENSE](LICENSE)。
|
package/dist/browser.js
CHANGED
|
@@ -16160,9 +16160,15 @@ var createPatch = async (original, modified, options = {}) => {
|
|
|
16160
16160
|
if (sourceFiles.has(path) && before.equals(after)) continue;
|
|
16161
16161
|
if (!sourceFiles.has(path) && !/^(data|overlay)\//.test(path) && !/^overarm[97]\.bin$/.test(path))
|
|
16162
16162
|
warnings.push(`\u65B0\u589E\u7CFB\u7EDF\u6587\u4EF6\uFF1A${file.path}`);
|
|
16163
|
+
changedFiles++;
|
|
16164
|
+
if (!sourceFiles.has(path) || after.length < 128 * 1024) {
|
|
16165
|
+
entries[file.path] = after;
|
|
16166
|
+
continue;
|
|
16167
|
+
}
|
|
16163
16168
|
try {
|
|
16164
16169
|
const delta = await createDelta(before, after);
|
|
16165
|
-
if (
|
|
16170
|
+
if (delta.length > after.length * 0.8) entries[file.path] = after;
|
|
16171
|
+
else if (decodeXdelta(before, delta, options).equals(after)) entries[`xdelta/${file.path}`] = delta;
|
|
16166
16172
|
else {
|
|
16167
16173
|
warnings.push(`\u6587\u4EF6\u5DEE\u5206\u89E3\u7801\u5185\u5BB9\u4E0D\u540C\uFF0C\u5DF2\u4FDD\u5B58\u5B8C\u6574\u66FF\u6362\u5185\u5BB9\uFF1A${file.path}`);
|
|
16168
16174
|
entries[file.path] = after;
|
|
@@ -16171,7 +16177,6 @@ var createPatch = async (original, modified, options = {}) => {
|
|
|
16171
16177
|
warnings.push(`\u6587\u4EF6\u5DEE\u5206\u68C0\u67E5\u672A\u5B8C\u6210\uFF0C\u5DF2\u4FDD\u5B58\u5B8C\u6574\u66FF\u6362\u5185\u5BB9\uFF1A${file.path}\uFF1A${errorMessage(reason)}`);
|
|
16172
16178
|
entries[file.path] = after;
|
|
16173
16179
|
}
|
|
16174
|
-
changedFiles++;
|
|
16175
16180
|
}
|
|
16176
16181
|
const metadata = { ...options.metadata, formatVersion: 2 };
|
|
16177
16182
|
const inputMd5 = hashDigest("md5", input).toString("hex");
|