systeminformation 5.33.6 → 5.33.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/README.md CHANGED
@@ -35,7 +35,7 @@ lines of code, > 750 versions published, up to 50 mio downloads per month, > 700
35
35
  mio downloads overall. Top 5 NPM ranking for backend packages. Thank you to all
36
36
  who contributed to this project!
37
37
 
38
- > **Version 6** beta just released ⭐️⭐️⭐️
38
+ > ### **Version 6** beta just released ⭐️⭐️⭐️
39
39
  >
40
40
  > 🏆🏆🏆 We're proud to have just released the first beta of the new version 6 of systeminformation.
41
41
  > Version 6 of this package (written completely in TypeScript) is
package/lib/audio.js CHANGED
@@ -55,7 +55,7 @@ function parseAudioType(str, input, output) {
55
55
  if (str.indexOf('mikr') >= 0) {
56
56
  result = 'Microphone';
57
57
  }
58
- if (str.indexOf('phone') >= 0) {
58
+ if (str.indexOf('phone') >= 0 && str.indexOf('headphone') < 0) {
59
59
  result = 'Phone';
60
60
  }
61
61
  if (str.indexOf('controll') >= 0) {
@@ -111,11 +111,16 @@ function parseLinuxAudioAlsa(stdout) {
111
111
  const lines = cards.split('\n');
112
112
  lines.forEach((line, i) => {
113
113
  // ' 1 [Device ]: USB-Audio - USB Audio Device'
114
- const card = line.match(/^\s*(\d+)\s+\[(.+?)\s*\]:\s*(\S+)\s+-\s+(.*)$/);
115
- if (card) {
114
+ const card = line.match(/^\s*(\d+)\s+\[(.+?)\s*\]:\s*(.*)$/);
115
+ if (card && card[3].trim()) {
116
116
  const index = card[1];
117
- const driver = card[3];
118
- const name = card[4].trim();
117
+ // some drivers (e.g. bcm2835) print an unterminated driver string, gluing the name to it
118
+ const sep = card[3].lastIndexOf(' - ');
119
+ const name = (sep >= 0 ? card[3].substring(sep + 3) : card[3]).trim();
120
+ let driver = (sep >= 0 ? card[3].substring(0, sep) : '').trim();
121
+ if (name && driver.endsWith(name)) {
122
+ driver = driver.substring(0, driver.length - name.length).trim();
123
+ }
119
124
  // second line holds the long name, which is prefixed with the manufacturer on USB devices
120
125
  const longName = (lines[i + 1] || '').trim();
121
126
  const manufacturer = longName.indexOf(name) > 0 ? longName.substring(0, longName.indexOf(name)).trim() : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.33.6",
3
+ "version": "5.33.7",
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)",