Merge pull request #556 from plakak/fix/windows-designed-capacity
fix: battery designed capacity on windows
This commit is contained in:
commit
40366de1a9
@ -220,8 +220,8 @@ module.exports = function (callback) {
|
|||||||
// let parts = data.results[0].split(/\n\s*\n/);
|
// let parts = data.results[0].split(/\n\s*\n/);
|
||||||
let parts = data.results[0].split('\r\n');
|
let parts = data.results[0].split('\r\n');
|
||||||
let batteries = [];
|
let batteries = [];
|
||||||
for (let i = 0; i < parts.length; i++) {
|
|
||||||
const hasValue = value => /\S/.test(value);
|
const hasValue = value => /\S/.test(value);
|
||||||
|
for (let i = 0; i < parts.length; i++) {
|
||||||
if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) {
|
if (hasValue(parts[i]) && (!batteries.length || !hasValue(parts[i - 1]))) {
|
||||||
batteries.push([]);
|
batteries.push([]);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user