From ed7c5a5110618bf364dc4151b36a80db6738cffa Mon Sep 17 00:00:00 2001 From: Krut Patel Date: Wed, 10 May 2023 14:53:53 +0530 Subject: [PATCH] Update regex inside sanitizeVersion Enables sanitizing multi-digit numbers with a leading zero. --- wsEvents/getAppVersion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsEvents/getAppVersion.js b/wsEvents/getAppVersion.js index 6f11512f..701b3f3e 100644 --- a/wsEvents/getAppVersion.js +++ b/wsEvents/getAppVersion.js @@ -19,7 +19,7 @@ const sanitizeVersion = (ver) => { while (ver.match(/\./g).length > 2) ver = ver.replace(/.([^.]*)$/, '$1'); return ver - .replace(/\.0(\d)/gi, '.$1') // because apparently x.0y.z (ex. 5.09.51) isn't a valid version + .replace(/\.0(\d+)/gi, '.$1') // because apparently x.0y.z (ex. 5.09.51) isn't a valid version .replace(/^(\d+)\.(\d+)$/gi, '$1.$2.0'); // nor are versions without a patch (ex. 2.3) };