cpu() clean brand string

This commit is contained in:
Sebastian Hildebrandt 2025-01-02 15:42:16 +01:00
parent 3da3240962
commit 133b557eb6
3 changed files with 6 additions and 1 deletions

View File

@ -1186,7 +1186,7 @@ All other trademarks are the property of their respective owners.
[daviddm-url]: https://david-dm.org/sebhildebrandt/systeminformation
[issues-img]: https://img.shields.io/github/issues/sebhildebrandt/systeminformation.svg?style=flat-square
[issues-url]: https://github.com/sebhildebrandt/systeminformation/issues
[closed-issues-img]: https://img.shields.io/github/issues-closed-raw/sebhildebrandt/systeminformation.svg?style=flat-square&color=brightgreen
[closed-issues-img]: https://img.shields.io/github/issues-search?query=repo%3Asebhildebrandt/systeminformation+is%3Aclosed&style=flat-square&color=brightgreen&label=Issues+closed
[closed-issues-url]: https://github.com/sebhildebrandt/systeminformation/issues?q=is%3Aissue+is%3Aclosed
[new-issue]: https://github.com/sebhildebrandt/systeminformation/issues/new/choose
[mmon-npm-url]: https://npmjs.org/package/mmon

View File

@ -737,6 +737,7 @@ function getCpu() {
}
modelline = util.getValue(lines, 'model name') || modelline;
modelline = util.getValue(lines, 'bios model name') || modelline;
modelline = util.cleanString(modelline);
const modellineParts = modelline.split('@');
result.brand = modellineParts[0].trim();
result.speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;

View File

@ -2535,6 +2535,9 @@ function checkWebsite(url, timeout = 5000) {
});
};
function cleanString(str) {
return str.replace(/To Be Filled By O.E.M./g, '');
}
function noop() { }
exports.toInt = toInt;
@ -2591,3 +2594,4 @@ exports.getFilesInPath = getFilesInPath;
exports.semverCompare = semverCompare;
exports.getAppleModel = getAppleModel;
exports.checkWebsite = checkWebsite;
exports.cleanString = cleanString;