From 9cd869e3bb64ef55c48b31d4adb8f3f679a855ac Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 11 Oct 2023 22:06:12 +0000 Subject: [PATCH] ref: improve readability of arch sort --- _webi/normalize.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/_webi/normalize.js b/_webi/normalize.js index 1a75421..f2dd0bf 100644 --- a/_webi/normalize.js +++ b/_webi/normalize.js @@ -95,13 +95,14 @@ function normalize(all) { supported.oses[rel.os] = true; if (!rel.arch) { - arches.some(function (regKey) { - var arch = (rel.name || rel.download).match(archMap[regKey]) && regKey; - if (arch) { + for (let arch of arches) { + let name = rel.name || rel.download; + let isArch = name.match(archMap[arch]); + if (isArch) { rel.arch = arch; - return true; + break; } - }); + } } if (!rel.arch) { if ('macos' === rel.os) {