systeminformation 5.12.11 → 5.12.13

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/index.d.ts CHANGED
@@ -499,8 +499,8 @@ export namespace Systeminformation {
499
499
  operstate: string;
500
500
  type: string;
501
501
  duplex: string;
502
- mtu: number;
503
- speed: number;
502
+ mtu: number | null;
503
+ speed: number | null;
504
504
  dhcp: boolean;
505
505
  dnsSuffix: string;
506
506
  ieee8021xAuth: string;
package/lib/memory.js CHANGED
@@ -245,13 +245,13 @@ function mem(callback) {
245
245
  if (!error) {
246
246
  let lines = stdout.toString().split('\n');
247
247
  if (lines.length > 0) {
248
- let line = lines[0].replace(/,/g, '.').replace(/M/g, '');
249
- line = line.trim().split(' ');
250
- for (let i = 0; i < line.length; i++) {
251
- if (line[i].toLowerCase().indexOf('total') !== -1) { result.swaptotal = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }
252
- if (line[i].toLowerCase().indexOf('used') !== -1) { result.swapused = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }
253
- if (line[i].toLowerCase().indexOf('free') !== -1) { result.swapfree = parseFloat(line[i].split('=')[1].trim()) * 1024 * 1024; }
254
- }
248
+ let firstline = lines[0].replace(/,/g, '.').replace(/M/g, '');
249
+ let lineArray = firstline.trim().split(' ');
250
+ lineArray.forEach(line => {
251
+ if (line.toLowerCase().indexOf('total') !== -1) { result.swaptotal = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
252
+ if (line.toLowerCase().indexOf('used') !== -1) { result.swapused = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
253
+ if (line.toLowerCase().indexOf('free') !== -1) { result.swapfree = parseFloat(line.split('=')[1].trim()) * 1024 * 1024; }
254
+ });
255
255
  }
256
256
  }
257
257
  if (callback) { callback(result); }
package/lib/osinfo.js CHANGED
@@ -289,8 +289,6 @@ function osInfo(callback) {
289
289
  result.logofile = getLogoFile(result.distro);
290
290
  result.codename = 'macOS';
291
291
  result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);
292
- result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);
293
- result.codename = (result.release.indexOf('10.4') > -1 ? 'Mac OS X Tiger' : result.codename);
294
292
  result.codename = (result.release.indexOf('10.5') > -1 ? 'Mac OS X Leopard' : result.codename);
295
293
  result.codename = (result.release.indexOf('10.6') > -1 ? 'Mac OS X Snow Leopard' : result.codename);
296
294
  result.codename = (result.release.indexOf('10.7') > -1 ? 'Mac OS X Lion' : result.codename);
@@ -738,9 +736,9 @@ function versions(apps, callback) {
738
736
  if (_windows) {
739
737
  util.powerShell('Get-WmiObject Win32_Service | select caption | fl').then((stdout) => {
740
738
  let serviceSections = stdout.split(/\n\s*\n/);
741
- for (let i = 0; i < serviceSections.length; i++) {
742
- if (serviceSections[i].trim() !== '') {
743
- let lines = serviceSections[i].trim().split('\r\n');
739
+ serviceSections.forEach((item) => {
740
+ if (item.trim() !== '') {
741
+ let lines = item.trim().split('\r\n');
744
742
  let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();
745
743
  if (srvCaption.indexOf('postgresql') > -1) {
746
744
  const parts = srvCaption.split(' server ');
@@ -749,7 +747,7 @@ function versions(apps, callback) {
749
747
  }
750
748
  }
751
749
  }
752
- }
750
+ });
753
751
  functionProcessed();
754
752
  });
755
753
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.12.11",
3
+ "version": "5.12.13",
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)",