systeminformation 5.12.2 → 5.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cpu.js CHANGED
@@ -645,6 +645,7 @@ function getCpu() {
645
645
  result.family = util.getValue(lines, 'machdep.cpu.family') || util.getValue(lines, 'hw.cpufamily');
646
646
  result.model = util.getValue(lines, 'machdep.cpu.model');
647
647
  result.stepping = util.getValue(lines, 'machdep.cpu.stepping') || util.getValue(lines, 'hw.cpusubfamily');
648
+ result.virtualization = true;
648
649
  const countProcessors = util.getValue(lines, 'hw.packages');
649
650
  const countCores = util.getValue(lines, 'hw.physicalcpu_max');
650
651
  const countThreads = util.getValue(lines, 'hw.ncpu');
@@ -1066,9 +1067,9 @@ function cpuTemperature(callback) {
1066
1067
  });
1067
1068
 
1068
1069
  if (result.cores.length > 0) {
1069
- if (result.main === null) {
1070
- result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1071
- }
1070
+ // if (result.main === null) {
1071
+ result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1072
+ // }
1072
1073
  let maxtmp = Math.max.apply(Math, result.cores);
1073
1074
  result.max = (maxtmp > result.main) ? maxtmp : result.main;
1074
1075
  }
@@ -1122,9 +1123,9 @@ function cpuTemperature(callback) {
1122
1123
  }
1123
1124
  });
1124
1125
  if (result.cores.length > 0) {
1125
- if (result.main === null) {
1126
- result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1127
- }
1126
+ // if (result.main === null) {
1127
+ result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1128
+ // }
1128
1129
  let maxtmp = Math.max.apply(Math, result.cores);
1129
1130
  result.max = (maxtmp > result.main) ? maxtmp : result.main;
1130
1131
  } else {
package/lib/network.js CHANGED
@@ -494,7 +494,8 @@ function parseLinesDarwinNics(sections) {
494
494
  }
495
495
  }
496
496
  nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';
497
- nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down';
497
+ const operstate = util.getValue(section, 'status').toLowerCase();
498
+ nic.operstate = (operstate === 'active' ? 'up' : (operstate === 'inactive' ? 'down' : 'unknown'));
498
499
  nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';
499
500
  if (nic.ip6 || nic.ip4 || nic.mac) {
500
501
  nics.push(nic);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.12.2",
3
+ "version": "5.12.5",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",