mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
Remove includeHash option to toModPackString
Since the Mod Portal provides SHA1 hashes it makes sense to always include the hashes with mod pack strings if they are available.
This commit is contained in:
1 parent
9b4ca86650
commit
af79e2abbd
2 files changed
+2
-9
No files matched your search
@@ -170,16 +170,9 @@ class ModPack {
|
||||
return json;
|
||||
}
|
||||
|
||||
toModPackString(includeHash = false) {
|
||||
toModPackString() {
|
||||
const json = this.toJSON();
|
||||
delete json.id;
|
||||
if (json.mods && !includeHash) {
|
||||
json.mods = json.mods.map(m => {
|
||||
m = { ...m };
|
||||
delete m.sha1;
|
||||
return m;
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line node/no-sync
|
||||
let buf = zlib.deflateSync(JSON.stringify(json));
|
||||
|
||||
@@ -16,7 +16,7 @@ describe("lib/data/ModPack", function() {
|
||||
throw validate.errors;
|
||||
}
|
||||
assert.deepEqual(new ModPack(json), pack);
|
||||
const packStringed = ModPack.fromModPackString(pack.toModPackString(true));
|
||||
const packStringed = ModPack.fromModPackString(pack.toModPackString());
|
||||
packStringed.id = pack.id;
|
||||
assert.deepEqual(packStringed, pack);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user