@hangtime/grip-connect 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/is-connected.d.ts +1 -1
- package/src/is-connected.js +2 -2
- package/src/is-connected.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hangtime/grip-connect",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A client that can establish connections with various Force-Sensing Hangboards/Plates used by climbers for strength measurement. Examples of such hangboards include the Griptonite Motherboard, Climbro, SmartBoard, Entralpi or Tindeq Progressor",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
package/src/is-connected.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import { Device } from "./devices/types";
|
|
|
4
4
|
* @param {Device} board - The device to check for connection.
|
|
5
5
|
* @returns {boolean} A boolean indicating whether the device is connected.
|
|
6
6
|
*/
|
|
7
|
-
export declare const isConnected: (board
|
|
7
|
+
export declare const isConnected: (board?: Device) => boolean;
|
package/src/is-connected.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @returns {boolean} A boolean indicating whether the device is connected.
|
|
5
5
|
*/
|
|
6
6
|
export const isConnected = (board) => {
|
|
7
|
-
// Check if the device is available
|
|
8
|
-
if (!board
|
|
7
|
+
// Check if the device is defined and available
|
|
8
|
+
if (!board?.device) {
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
11
|
// Check if the device is connected using optional chaining
|
package/src/is-connected.ts
CHANGED
|
@@ -5,9 +5,9 @@ import { Device } from "./devices/types"
|
|
|
5
5
|
* @param {Device} board - The device to check for connection.
|
|
6
6
|
* @returns {boolean} A boolean indicating whether the device is connected.
|
|
7
7
|
*/
|
|
8
|
-
export const isConnected = (board
|
|
9
|
-
// Check if the device is available
|
|
10
|
-
if (!board
|
|
8
|
+
export const isConnected = (board?: Device): boolean => {
|
|
9
|
+
// Check if the device is defined and available
|
|
10
|
+
if (!board?.device) {
|
|
11
11
|
return false
|
|
12
12
|
}
|
|
13
13
|
// Check if the device is connected using optional chaining
|