diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ceea04..b7f6492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,6 +100,7 @@ Other changes | Version | Date | Comment | | -------------- | -------------- | -------- | +| 3.49.1 | 2018-11-19 | `cpu().brand` removed extra spaces, tabs | | 3.49.0 | 2018-11-19 | added system `uuid()` (os specific), `versions()` added postgresql | | 3.48.4 | 2018-11-18 | windows: garbled output because of codepage | | 3.48.3 | 2018-11-18 | `dockerContainerStats()` fixed issue `cpu_percent` win | diff --git a/lib/cpu.js b/lib/cpu.js index 7506533..6177fef 100644 --- a/lib/cpu.js +++ b/lib/cpu.js @@ -115,10 +115,10 @@ const AMDBaseFrequencies = { }; function cpuBrandManufacturer(res) { - res.brand = res.brand.replace(/\(R\)+/g, '®'); - res.brand = res.brand.replace(/\(TM\)+/g, '™'); - res.brand = res.brand.replace(/\(C\)+/g, '©'); - res.brand = res.brand.replace(/CPU+/g, '').trim(); + res.brand = res.brand.replace(/\(R\)+/g, '®').replace(/\s+/g, ' ').trim(); + res.brand = res.brand.replace(/\(TM\)+/g, '™').replace(/\s+/g, ' ').trim(); + res.brand = res.brand.replace(/\(C\)+/g, '©').replace(/\s+/g, ' ').trim(); + res.brand = res.brand.replace(/CPU+/g, '').replace(/\s+/g, ' ').trim(); res.manufacturer = res.brand.split(' ')[0]; let parts = res.brand.split(' ');