From: Justin Wind Date: Tue, 26 Nov 2024 18:14:21 +0000 (-0800) Subject: fix best-version determination for versions >9 X-Git-Tag: v2.1.0~3 X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=4c3bc2d80f98d84ddbd8306c826286f42f627e0a;p=squeep-mystery-box fix best-version determination for versions >9 --- diff --git a/lib/mystery-box.js b/lib/mystery-box.js index c7ddf18..080bc17 100644 --- a/lib/mystery-box.js +++ b/lib/mystery-box.js @@ -98,7 +98,7 @@ class MysteryBox extends EventEmitter { }, {}); // Default to highest - this.bestVersion = Number(Object.keys(this.versionParameters).sort().pop()); + this.bestVersion = Number(Object.keys(this.versionParameters).sort((a, b) => a - b).pop()); if (Number.isNaN(this.bestVersion)) { throw new MysteryBoxError('no supported versions available'); }