systeminformation 5.16.4 → 5.16.6

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/internet.js CHANGED
@@ -158,24 +158,20 @@ function inetLatency(host, callback) {
158
158
  return resolve(null);
159
159
  }
160
160
  let params;
161
- let filt;
162
161
  if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
163
162
  if (_linux) {
164
163
  params = ['-c', '2', '-w', '3', hostSanitized];
165
- filt = 'rtt';
166
164
  }
167
165
  if (_freebsd || _openbsd || _netbsd) {
168
166
  params = ['-c', '2', '-t', '3', hostSanitized];
169
- filt = 'round-trip';
170
167
  }
171
168
  if (_darwin) {
172
169
  params = ['-c2', '-t3', hostSanitized];
173
- filt = 'avg';
174
170
  }
175
171
  util.execSafe('ping', params).then((stdout) => {
176
172
  let result = null;
177
173
  if (stdout) {
178
- const lines = stdout.split('\n').filter(line => line.indexOf(filt) >= 0).join('\n');
174
+ const lines = stdout.split('\n').filter((line) => (line.indexOf('rtt') >= 0 || line.indexOf('round-trip') >= 0 || line.indexOf('avg') >= 0)).join('\n');
179
175
 
180
176
  const line = lines.split('=');
181
177
  if (line.length > 1) {
package/lib/processes.js CHANGED
@@ -653,12 +653,12 @@ function processes(callback) {
653
653
  function parseProcesses2(lines) {
654
654
 
655
655
  function formatDateTime(time) {
656
- const month = ('0' + (time.getMonth() + 1).toString()).substr(-2);
656
+ const month = ('0' + (time.getMonth() + 1).toString()).slice(-2);
657
657
  const year = time.getFullYear().toString();
658
- const day = ('0' + time.getDate().toString()).substr(-2);
659
- const hours = time.getHours().toString();
660
- const mins = time.getMinutes().toString();
661
- const secs = ('0' + time.getSeconds().toString()).substr(-2);
658
+ const day = ('0' + time.getDate().toString()).slice(-2);
659
+ const hours = ('0' + time.getHours().toString()).slice(-2);
660
+ const mins = ('0' + time.getMinutes().toString()).slice(-2);
661
+ const secs = ('0' + time.getSeconds().toString()).slice(-2);
662
662
 
663
663
  return (year + '-' + month + '-' + day + ' ' + hours + ':' + mins + ':' + secs);
664
664
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.16.4",
3
+ "version": "5.16.6",
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)",