systeminformation 5.7.6 → 5.7.7

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/CHANGELOG.md CHANGED
@@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
77
77
 
78
78
  | Version | Date | Comment |
79
79
  | -------------- | -------------- | -------- |
80
+ | 5.7.7 | 2021-06-15 | `graphics()` improved detection screen resolution (macOS) |
80
81
  | 5.7.6 | 2021-06-09 | `battery()` improved detection (additional batteries windows) |
81
82
  | 5.7.5 | 2021-06-08 | `memLayout()` improved clock speed detection (windows) |
82
83
  | 5.7.4 | 2021-05-27 | `osInfo()`, `cpu()` improved hypervisor, virtualization detection (windows) |
package/lib/battery.js CHANGED
@@ -231,7 +231,7 @@ module.exports = function (callback) {
231
231
  }
232
232
  let designCapacities = data.results[1].split('\r\n');
233
233
  let fullChargeCapacities = data.results[2].split('\r\n');
234
- if (batteries && batteries.length) {
234
+ if (batteries.length) {
235
235
  let first = false;
236
236
  let additionalBatteries = [];
237
237
  for (let i = 0; i < batteries.length; i++) {
package/lib/graphics.js CHANGED
@@ -172,10 +172,20 @@ function graphics(callback) {
172
172
  if (4 === level) { // display controller details level
173
173
  if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('resolution') !== -1) {
174
174
  let resolution = parts[1].split('x');
175
- currentDisplay.resolutionX = (resolution.length > 1 ? parseInt(resolution[0]) : 0);
176
- currentDisplay.resolutionY = (resolution.length > 1 ? parseInt(resolution[1]) : 0);
177
- currentDisplay.currentResX = currentDisplay.resolutionX;
178
- currentDisplay.currentResY = currentDisplay.resolutionY;
175
+ if (resolution.length > 1) {
176
+ let xpart = resolution[0];
177
+ if (xpart.indexOf('(') !== -1) {
178
+ xpart = xpart.split('(').slice(-1)[0];
179
+ }
180
+ let ypart = resolution[1];
181
+ if (ypart.indexOf(')') !== -1) {
182
+ ypart = ypart.split(')')[0];
183
+ }
184
+ currentDisplay.resolutionX = parseInt(xpart) || 0;
185
+ currentDisplay.resolutionY = parseInt(ypart) || 0;
186
+ currentDisplay.currentResX = currentDisplay.resolutionX;
187
+ currentDisplay.currentResY = currentDisplay.resolutionY;
188
+ }
179
189
  }
180
190
  if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('pixeldepth') !== -1) { currentDisplay.pixelDepth = parseInt(parts[1]); } // in BIT
181
191
  if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('framebufferdepth') !== -1) { currentDisplay.pixelDepth = parseInt(parts[1]); } // in BIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.7.6",
3
+ "version": "5.7.7",
4
4
  "description": "Simple system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",