UNPKG

@neurosity/sdk

Version:
26 lines (25 loc) 1.03 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.osHasBluetoothSupport = void 0; const gte_1 = __importDefault(require("semver/functions/gte")); function osHasBluetoothSupport(selectedDevice, osVersion) { if (!selectedDevice) { return false; } // Only the Crown supports Bluetooth const isCrown = Number(selectedDevice.modelVersion) >= 3; if (!isCrown) { return false; } const isEmulator = !!(selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.emulator); if (isEmulator) { return false; } // `osVersion` is updated in real time, // unlike accessing via `selectedDevice.osVersion` return (0, gte_1.default)(osVersion !== null && osVersion !== void 0 ? osVersion : selectedDevice.osVersion, "16.0.0"); } exports.osHasBluetoothSupport = osHasBluetoothSupport;