another optimization battery().ischarging for macOS
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ module.exports = function (callback) {
|
||||
}
|
||||
}
|
||||
if (parts && parts[1]) {
|
||||
result.ischarging = parts[1].trim() !== 'discharging';
|
||||
result.ischarging = parts[1].trim() !== 'charged';
|
||||
} else {
|
||||
result.ischarging = util.getValue(lines, 'ischarging', '=').toLowerCase() === 'yes';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user