From af79e2abbdcc075a0e87f462a8e76d197cb28e01 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 24 Sep 2022 21:49:41 +0200 Subject: [PATCH] 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. --- packages/lib/data/ModPack.js | 9 +-------- test/lib/data/ModPack.js | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/lib/data/ModPack.js b/packages/lib/data/ModPack.js index c13e6bf0..ed9ac60d 100644 --- a/packages/lib/data/ModPack.js +++ b/packages/lib/data/ModPack.js @@ -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)); diff --git a/test/lib/data/ModPack.js b/test/lib/data/ModPack.js index 9d08bdc5..fede2912 100644 --- a/test/lib/data/ModPack.js +++ b/test/lib/data/ModPack.js @@ -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); }