From b20a1f05a3a5eae324adc5a4b54b8b87e8c87598 Mon Sep 17 00:00:00 2001 From: Karl Obermiller Date: Fri, 6 Apr 2018 10:58:47 -0400 Subject: [PATCH] v0.2.0 --- bt.js | 18 ++++-------------- package.json | 2 +- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/bt.js b/bt.js index c6a955f..b48bc34 100644 --- a/bt.js +++ b/bt.js @@ -14,7 +14,8 @@ var Bluetooth = {}; /** * Determines if bluetooth is supported on this device * by searching for a bluetooth radio. - * @returns {boolean} whether or not bluetooth is supported. + * @returns {Promise} resolves a boolean representing whether + * or not bluetooth is supported. */ Bluetooth.isSupported = isSupported = async function () { let radios = await _promisify(Radio.getRadiosAsync)(); @@ -32,7 +33,8 @@ Bluetooth.isSupported = isSupported = async function () { /** * Determines if bluetooth is enabled on this device * by searching for a bluetooth radio that is enabled. - * @returns {boolean} whether or not bluetooth is enabled. + * @returns {Promise} resolves a boolean representing whether + * or not bluetooth is enabled. */ Bluetooth.isEnabled = isEnabled = async function () { let radios = await _promisify(Radio.getRadiosAsync)(); @@ -210,18 +212,6 @@ function _treatAddress(address) { } } -/** - * Creates a callback that will resolve or reject a promise accordingly. - * @param {Function} res - Promise resolve function. - * @param {Function} rej - Promise reject function. - */ -function _promiseWrapperCB(res, rej) { - return function(err, result) { - if (err) rej(err); - else res(result); - } -} - /** * Turns the given function that takes a callback as the last argument * into a function that returns a promise. diff --git a/package.json b/package.json index 1704167..fabb965 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "win-bt", - "version": "0.1.3", + "version": "0.2.0", "description": "", "main": "bt.js", "bundleDependencies": [