systeminformation 5.17.14 → 5.17.15

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/osinfo.js CHANGED
@@ -1053,7 +1053,7 @@ function getUniqueMacAdresses() {
1053
1053
  for (let dev in ifaces) {
1054
1054
  if ({}.hasOwnProperty.call(ifaces, dev)) {
1055
1055
  ifaces[dev].forEach(function (details) {
1056
- if (details && details.mac && details.mac !== '00:00:00:00:00:00') {
1056
+ if (details?.mac && details.mac !== '00:00:00:00:00:00') {
1057
1057
  const mac = details.mac.toLowerCase();
1058
1058
  if (macs.indexOf(mac) === -1) {
1059
1059
  macs.push(mac);
package/lib/util.js CHANGED
@@ -315,7 +315,7 @@ function getWmic() {
315
315
  if (!fs.existsSync(wmicPath)) {
316
316
  try {
317
317
  const wmicPathArray = execSync('WHERE WMIC', execOptsWin).toString().split('\r\n');
318
- if (wmicPathArray && wmicPathArray.length) {
318
+ if (wmicPathArray?.length) {
319
319
  wmicPath = wmicPathArray[0];
320
320
  } else {
321
321
  wmicPath = 'wmic';
@@ -378,14 +378,14 @@ function powerShellProceedResults(data) {
378
378
 
379
379
  function powerShellStart() {
380
380
  if (!_psChild) {
381
- _psChild = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-Command', '-'], {
381
+ _psChild = spawn('powershell.exe', ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-Command', '-'], {
382
382
  stdio: 'pipe',
383
383
  windowsHide: true,
384
384
  maxBuffer: 1024 * 20000,
385
385
  encoding: 'UTF-8',
386
386
  env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })
387
387
  });
388
- if (_psChild && _psChild.pid) {
388
+ if (_psChild?.pid) {
389
389
  _psPersistent = true;
390
390
  _psChild.stdout.on('data', function (data) {
391
391
  _psResult = _psResult + data.toString('utf8');
@@ -436,7 +436,7 @@ function powerShell(cmd) {
436
436
  start: new Date()
437
437
  });
438
438
  try {
439
- if (_psChild && _psChild.pid) {
439
+ if (_psChild?.pid) {
440
440
  _psChild.stdin.write(_psToUTF8 + 'echo ' + _psCmdStart + id + _psIdSeperator + '; ' + os.EOL + cmd + os.EOL + 'echo ' + _psCmdSeperator + os.EOL);
441
441
  }
442
442
  } catch (e) {
@@ -451,7 +451,7 @@ function powerShell(cmd) {
451
451
  return new Promise((resolve) => {
452
452
  process.nextTick(() => {
453
453
  try {
454
- const child = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {
454
+ const child = spawn('powershell.exe', ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {
455
455
  stdio: 'pipe',
456
456
  windowsHide: true,
457
457
  maxBuffer: 1024 * 20000,
@@ -464,7 +464,7 @@ function powerShell(cmd) {
464
464
  resolve(result);
465
465
  });
466
466
  }
467
- if (child && child.pid) {
467
+ if (child?.pid) {
468
468
  child.stdout.on('data', function (data) {
469
469
  result = result + data.toString('utf8');
470
470
  });
@@ -514,7 +514,7 @@ function execSafe(cmd, args, options) {
514
514
  resolve(result);
515
515
  });
516
516
  }
517
- if (child && child.pid) {
517
+ if (child?.pid) {
518
518
  child.stdout.on('data', function (data) {
519
519
  result += data.toString();
520
520
  });
@@ -576,7 +576,7 @@ function smartMonToolsInstalled() {
576
576
  if (_windows) {
577
577
  try {
578
578
  const pathArray = execSync('WHERE smartctl 2>nul', execOptsWin).toString().split('\r\n');
579
- if (pathArray && pathArray.length) {
579
+ if (pathArray?.length) {
580
580
  _smartMonToolsInstalled = pathArray[0].indexOf(':\\') >= 0;
581
581
  } else {
582
582
  _smartMonToolsInstalled = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.17.14",
3
+ "version": "5.17.15",
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)",