Merge pull request #556 from plakak/fix/windows-designed-capacity

fix: battery designed capacity on windows
This commit is contained in:
Sebastian Hildebrandt 2021-07-17 16:17:40 +02:00 committed by GitHub
commit 40366de1a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,8 +220,8 @@ module.exports = function (callback) {
// let parts = data.results[0].split(/\n\s*\n/);
let parts = data.results[0].split('\r\n');
let batteries = [];
const hasValue = value => /\S/.test(value);
for (let i = 0; i < parts.length; i++) {
const hasValue = value => /\S/.test(value);
if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) {
batteries.push([]);
}