diff --git a/README.md b/README.md index 5a5aa1c..e9ff72d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ Also compares versions lexicographically. "arch": "aarch64", "os": "linux", "libc": "none", - "vendor": "unknown" + "vendor": "unknown", + "unknownTerms": ["infra"] } ``` diff --git a/host-targets.js b/host-targets.js index 10943b7..14828f1 100644 --- a/host-targets.js +++ b/host-targets.js @@ -130,6 +130,7 @@ HostTargets._MATCHERS = { /** * @param {Object.<"os"|"arch"|"libc", String>} target + * @param {Array} terms */ HostTargets.termsToTarget = function (target, terms) { let bogoTerms = []; diff --git a/lexver.js b/lexver.js index d776db1..d296850 100644 --- a/lexver.js +++ b/lexver.js @@ -187,7 +187,7 @@ Lexver.parsePrefix = function (version) { * Ex: use '0001.0003' to find previous, stable, default, beta, and next * @param {Array} versions - sorted lexical versions * @param {String} prefix - the string to match - * @returns {String} + * @returns {Object.} */ Lexver.matchSorted = function (versions, prefix) { let matches = []; diff --git a/package-lock.json b/package-lock.json index 71e7279..d787aec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "build-classifier", - "version": "0.9.3", + "version": "0.9.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "build-classifier", - "version": "0.9.3", + "version": "0.9.4", "license": "SEE LICENSE IN LICENSE" } } diff --git a/package.json b/package.json index 23d8643..e7f653c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "build-classifier", - "version": "0.9.3", + "version": "0.9.4", "description": "Determine Host Target Triplet (Arch, Libc, OS, Vendor) from a filenames / download URL and uname / User-Agent strings.", "main": "index.js", "scripts": { diff --git a/triplet.js b/triplet.js index 67d10c6..92e359c 100644 --- a/triplet.js +++ b/triplet.js @@ -678,14 +678,14 @@ var Triplet = ('object' === typeof module && exports) || {}; vendor: build.vendor || '', libc: build.libc || '', //ext: build.ext || '', + unknownTerms: [], }); for (let term of terms) { let knownMatch = Triplet.TERMS_PRIMARY_MAP[term]; if (!knownMatch) { - let msg = `${proj.name}: unrecognized term '${term}' in '${terms}'`; - let err = new Error(msg); - throw err; + target.unknownTerms.push(term); + continue; } //console.log('dbg-known:', term, knownMatch); diff --git a/types.js b/types.js index 7ef8c22..207fdda 100644 --- a/types.js +++ b/types.js @@ -24,5 +24,6 @@ module.exports._types = true; * @prop {ArchString} arch * @prop {LibcString} libc * @prop {VendorString} [vendor] + * @prop {Array} [unknownTerms] * @prop {Boolean} [android] - for intermediary representation */