* Indicates whether the host is running on battery power. This can cause * performance degredation. * * @private * @method isUsingBattery * @for HardwareInfo * @param {String=process.platform} platform The current hardware platform. * U
(platform = process.platform)
| 246 | * cannot be determined. |
| 247 | */ |
| 248 | isUsingBattery(platform = process.platform) { |
| 249 | switch (platform) { |
| 250 | case 'darwin': |
| 251 | return isUsingBatteryDarwin(); |
| 252 | |
| 253 | case 'freebsd': |
| 254 | case 'openbsd': |
| 255 | return isUsingBatteryBsd(); |
| 256 | |
| 257 | case 'linux': |
| 258 | return isUsingBatteryLinux(); |
| 259 | |
| 260 | case 'win32': |
| 261 | return isUsingBatteryWindows(); |
| 262 | } |
| 263 | |
| 264 | logger.warn(`Battery status is unsupported on the '${platform}' platform.`); |
| 265 | |
| 266 | return null; |
| 267 | }, |
| 268 | |
| 269 | /** |
| 270 | * Determines the amount of swap/virtual memory currently in use. |
nothing calls this directly
no test coverage detected
searching dependent graphs…