systeminformation 5.24.3 → 5.24.5

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/docker.js CHANGED
@@ -456,7 +456,11 @@ function dockerContainerStats(containerIDs, callback) {
456
456
  try {
457
457
  containerIDsSanitized.__proto__.toLowerCase = util.stringToLower;
458
458
  containerIDsSanitized.__proto__.replace = util.stringReplace;
459
+ containerIDsSanitized.__proto__.toString = util.stringToString;
460
+ containerIDsSanitized.__proto__.substr = util.stringSubstr;
461
+ containerIDsSanitized.__proto__.substring = util.stringSubstring;
459
462
  containerIDsSanitized.__proto__.trim = util.stringTrim;
463
+ containerIDsSanitized.__proto__.startsWith = util.stringStartWith;
460
464
  } catch (e) {
461
465
  Object.setPrototypeOf(containerIDsSanitized, util.stringObj);
462
466
  }
package/lib/network.js CHANGED
@@ -1177,7 +1177,11 @@ function networkStats(ifaces, callback) {
1177
1177
  try {
1178
1178
  ifaces.__proto__.toLowerCase = util.stringToLower;
1179
1179
  ifaces.__proto__.replace = util.stringReplace;
1180
+ ifaces.__proto__.toString = util.stringToString;
1181
+ ifaces.__proto__.substr = util.stringSubstr;
1182
+ ifaces.__proto__.substring = util.stringSubstring;
1180
1183
  ifaces.__proto__.trim = util.stringTrim;
1184
+ ifaces.__proto__.startsWith = util.stringStartWith;
1181
1185
  } catch (e) {
1182
1186
  Object.setPrototypeOf(ifaces, util.stringObj);
1183
1187
  }
package/lib/processes.js CHANGED
@@ -129,7 +129,11 @@ function services(srv, callback) {
129
129
  try {
130
130
  srvString.__proto__.toLowerCase = util.stringToLower;
131
131
  srvString.__proto__.replace = util.stringReplace;
132
+ srvString.__proto__.toString = util.stringToString;
133
+ srvString.__proto__.substr = util.stringSubstr;
134
+ srvString.__proto__.substring = util.stringSubstring;
132
135
  srvString.__proto__.trim = util.stringTrim;
136
+ srvString.__proto__.startsWith = util.stringStartWith;
133
137
  } catch (e) {
134
138
  Object.setPrototypeOf(srvString, util.stringObj);
135
139
  }
@@ -989,7 +993,12 @@ function processLoad(proc, callback) {
989
993
  try {
990
994
  processesString.__proto__.toLowerCase = util.stringToLower;
991
995
  processesString.__proto__.replace = util.stringReplace;
996
+ processesString.__proto__.toString = util.stringToString;
997
+ processesString.__proto__.substr = util.stringSubstr;
998
+ processesString.__proto__.substring = util.stringSubstring;
992
999
  processesString.__proto__.trim = util.stringTrim;
1000
+ processesString.__proto__.startsWith = util.stringStartWith;
1001
+
993
1002
  } catch (e) {
994
1003
  Object.setPrototypeOf(processesString, util.stringObj);
995
1004
  }
package/lib/users.js CHANGED
@@ -105,10 +105,18 @@ function parseUsersDarwin(lines) {
105
105
 
106
106
  // who part
107
107
  if (is_whopart) {
108
+ let dt = ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
109
+ try {
110
+ if (new Date(dt) > new Date) {
111
+ dt = ('' + (new Date().getFullYear() - 1)) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2);
112
+ }
113
+ } catch {
114
+ util.noop();
115
+ }
108
116
  result_who.push({
109
117
  user: l[0],
110
118
  tty: l[1],
111
- date: ('' + new Date().getFullYear()) + '-' + ('0' + ('JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC'.indexOf(l[2].toUpperCase()) / 3 + 1)).slice(-2) + '-' + ('0' + l[3]).slice(-2),
119
+ date: dt,
112
120
  time: l[4],
113
121
  });
114
122
  } else {
@@ -146,7 +154,7 @@ function users(callback) {
146
154
 
147
155
  // linux
148
156
  if (_linux) {
149
- exec('who --ips; echo "---"; w | tail -n +2', function (error, stdout) {
157
+ exec('export LC_ALL=C; who --ips; echo "---"; w; unset LC_ALL | tail -n +2', function (error, stdout) {
150
158
  if (!error) {
151
159
  // lines / split
152
160
  let lines = stdout.toString().split('\n');
@@ -195,7 +203,7 @@ function users(callback) {
195
203
  }
196
204
 
197
205
  if (_darwin) {
198
- exec('who; echo "---"; w -ih', function (error, stdout) {
206
+ exec('export LC_ALL=C; who; echo "---"; w -ih; unset LC_ALL', function (error, stdout) {
199
207
  if (!error) {
200
208
  // lines / split
201
209
  let lines = stdout.toString().split('\n');
package/lib/util.js CHANGED
@@ -89,6 +89,7 @@ const stringReplace = new String().replace;
89
89
  const stringToLower = new String().toLowerCase;
90
90
  const stringToString = new String().toString;
91
91
  const stringSubstr = new String().substr;
92
+ const stringSubstring = new String().substring;
92
93
  const stringTrim = new String().trim;
93
94
  const stringStartWith = new String().startsWith;
94
95
  const mathMin = Math.min;
@@ -764,6 +765,9 @@ function isPrototypePolluted() {
764
765
  st.__proto__.toLowerCase = stringToLower;
765
766
  st.__proto__.toString = stringToString;
766
767
  st.__proto__.substr = stringSubstr;
768
+ st.__proto__.substring = stringSubstring;
769
+ st.__proto__.trim = stringTrim;
770
+ st.__proto__.startsWith = stringStartWith;
767
771
  } catch (e) {
768
772
  Object.setPrototypeOf(st, stringObj);
769
773
  }
@@ -2578,6 +2582,7 @@ exports.stringReplace = stringReplace;
2578
2582
  exports.stringToLower = stringToLower;
2579
2583
  exports.stringToString = stringToString;
2580
2584
  exports.stringSubstr = stringSubstr;
2585
+ exports.stringSubstring = stringSubstring;
2581
2586
  exports.stringTrim = stringTrim;
2582
2587
  exports.stringStartWith = stringStartWith;
2583
2588
  exports.mathMin = mathMin;
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.24.3",
3
+ "version": "5.24.5",
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)",
7
7
  "homepage": "https://systeminformation.io",
8
8
  "main": "./lib/index.js",
9
+ "type": "commonjs",
9
10
  "bin": {
10
11
  "systeminformation": "lib/cli.js"
11
12
  },
12
13
  "types": "./lib/index.d.ts",
13
14
  "scripts": {
14
- "test": "node ./test/test.js"
15
+ "test": "node ./test/test.js",
16
+ "testDeno": "deno run -A ./test/test.js"
15
17
  },
16
18
  "files": [
17
19
  "lib/"