systeminformation 5.31.10 → 5.31.11

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.
Files changed (2) hide show
  1. package/lib/graphics.js +11 -3
  2. package/package.json +1 -1
package/lib/graphics.js CHANGED
@@ -337,9 +337,17 @@ function graphics(callback) {
337
337
  currentController.bus = 'Onboard';
338
338
  }
339
339
  if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('region') !== -1 && parts[1].toLowerCase().indexOf('memory') !== -1) {
340
- let memparts = parts[1].split('=');
341
- if (memparts.length > 1) {
342
- currentController.vram = parseInt(memparts[1]);
340
+ const sizeMatch = parts[1].match(/size=(\d+)([KMG])?/i);
341
+ if (sizeMatch) {
342
+ let vram = parseInt(sizeMatch[1], 10);
343
+ const unit = (sizeMatch[2] || '').toUpperCase();
344
+ if (unit === 'G') { vram *= 1024; }
345
+ else if (unit === 'K') { vram = Math.round(vram / 1024); }
346
+ else if (unit === '') { vram = Math.round(vram / 1024 / 1024); } // bytes
347
+ // keep the largest memory region (the actual framebuffer aperture)
348
+ if (currentController.vram === null || vram > currentController.vram) {
349
+ currentController.vram = vram;
350
+ }
343
351
  }
344
352
  }
345
353
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.31.10",
3
+ "version": "5.31.11",
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)",