MCPcopy Create free account
hub / github.com/ember-cli/ember-cli / isUsingBattery

Function isUsingBattery

lib/models/hardware-info.js:248–267  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 4

isUsingBatteryDarwinFunction · 0.85
isUsingBatteryBsdFunction · 0.85
isUsingBatteryLinuxFunction · 0.85
isUsingBatteryWindowsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…