Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
obermillerk committed Apr 6, 2018
1 parent ee4b56c commit b20a1f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
18 changes: 4 additions & 14 deletions bt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)();
Expand All @@ -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)();
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "win-bt",
"version": "0.1.3",
"version": "0.2.0",
"description": "",
"main": "bt.js",
"bundleDependencies": [
Expand Down

0 comments on commit b20a1f0

Please sign in to comment.