| 4.27.5 |
2020-09-18 |
diff --git a/docs/index.html b/docs/index.html
index d0de8c6..b44c512 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -168,7 +168,7 @@
systeminformation
- Current Version: 4.27.5
+ Current Version: 4.27.6
diff --git a/lib/filesystem.js b/lib/filesystem.js
index dbe594b..e67284d 100755
--- a/lib/filesystem.js
+++ b/lib/filesystem.js
@@ -253,7 +253,7 @@ function parseBlk(lines) {
let data = [];
lines.filter(line => line !== '').forEach((line) => {
- line = util.decodeEscapeSequence(line);
+ line = decodeURIComponent(line.replace(/\\x/g, '%'));
line = line.replace(/\\/g, '\\\\');
let disk = JSON.parse(line);
data.push({
diff --git a/lib/index.js b/lib/index.js
index 2b3a2a6..91045df 100755
--- a/lib/index.js
+++ b/lib/index.js
@@ -331,13 +331,28 @@ function get(valueObject, callback) {
result[key] = data[i];
} else {
const keys = valueObject[key].replace(/,/g, ' ').replace(/ +/g, ' ').split(' ');
- const partialRes = {};
- keys.forEach(k => {
- if ({}.hasOwnProperty.call(data[i], k)) {
- partialRes[k] = data[i][k];
- }
- });
- result[key] = partialRes;
+ if (Array.isArray(data[i])) {
+ // result is in an array, go through all elements of array and pick only the right ones
+ const partialArray = [];
+ data[i].forEach(element => {
+ const partialRes = {};
+ keys.forEach(k => {
+ if ({}.hasOwnProperty.call(element, k)) {
+ partialRes[k] = element[k];
+ }
+ });
+ partialArray.push(partialRes);
+ });
+ result[key] = partialArray;
+ } else {
+ const partialRes = {};
+ keys.forEach(k => {
+ if ({}.hasOwnProperty.call(data[i], k)) {
+ partialRes[k] = data[i][k];
+ }
+ });
+ result[key] = partialRes;
+ }
}
i++;
}
@@ -355,7 +370,7 @@ function observe(valueObject, interval, callback) {
const result = setInterval(() => {
get(valueObject).then(data => {
if (JSON.stringify(_data) !== JSON.stringify(data)) {
- _data = Object.assign({}, data );
+ _data = Object.assign({}, data);
callback(data);
}
});