From 44a9a89bdf6f7b1c913662687c9c39a757c72181 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 7 May 2026 21:30:07 -0600 Subject: [PATCH 1/2] fix(lexver): parsePrefix output should always be a string-prefix of parseVersion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the input has a release suffix (e.g. '1.0.0-beta', '2025.11.15-15.42.45'), parsePrefix was skipping zero-padding the digit components even though parseVersion pads. The result was a string that didn't string-prefix-match the corresponding lexver: parseVersion('1.0.0-beta') // '0001.0000.0000.0000-beta' parsePrefix('1.0.0-beta') // '0001.0000.0000-beta' (mismatch) This broke matchSorted's prefix-search for any user-supplied complete version with a prerelease or build suffix — e.g. 'webi @2025.11.15-15.42.45' would silently return no matches. Fix: when there's a release suffix, treat the input as a complete reference and pad digits to 4 components before appending the suffix. Partial inputs without a suffix (e.g. '1.0' to match '0001.0000.x.y') still skip padding as before. --- lexver.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lexver.js b/lexver.js index d296850..c35e5a1 100644 --- a/lexver.js +++ b/lexver.js @@ -126,7 +126,9 @@ Lexver.parseVersion = function (fullVersion, _opts) { } // 1, 0 => 1, 0, 0, 0 - if (!_opts?._asPrefix) { + // Pad to 4 even for prefix parses when input has a release suffix — + // keeps parsePrefix(v) a true string-prefix of parseVersion(v). + if (!_opts?._asPrefix || rels.length) { for (; digits.length < 4; ) { digits.push('0'); } From 9f87804eb49016dc729766a34c96f419466f6310 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 7 May 2026 22:00:14 -0600 Subject: [PATCH 2/2] chore(release): bump to v1.0.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f5667b..92529e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "build-classifier", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "build-classifier", - "version": "1.0.2", + "version": "1.0.3", "license": "SEE LICENSE IN LICENSE" } } diff --git a/package.json b/package.json index 8744cb2..4f21266 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-classifier", - "version": "1.0.2", + "version": "1.0.3", "description": "Determine Host Target Triplet (Arch, Libc, OS, Vendor) from a filenames / download URL and uname / User-Agent strings.", "main": "index.js", "scripts": {