Updated deps, added exports
This commit is contained in:
parent
afe4eadf08
commit
9b4d496f34
8
package-lock.json
generated
8
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-poweredup",
|
||||
"version": "6.6.0",
|
||||
"version": "6.6.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -66,9 +66,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz",
|
||||
"integrity": "sha512-lCvvI24L21ZVeIiyIUHZ5Oflv1hhHQ5E1S25IRlKIXaRkVgmXpJMI3wUJkmym2bTbCe+WoIibQnMVAU3FguaOg==",
|
||||
"version": "14.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz",
|
||||
"integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/web-bluetooth": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-poweredup",
|
||||
"version": "6.6.0",
|
||||
"version": "6.6.1",
|
||||
"description": "A Javascript module to interface with LEGO Powered Up components.",
|
||||
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
|
||||
"main": "dist/node/index-node.js",
|
||||
@ -22,7 +22,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "4.1.5",
|
||||
"@types/node": "^14.0.11",
|
||||
"@types/node": "^14.0.13",
|
||||
"@types/web-bluetooth": "0.0.6",
|
||||
"ink-docstrap": "^1.3.2",
|
||||
"jsdoc": "^3.6.4",
|
||||
|
@ -39,6 +39,9 @@ import { TechnicXLargeLinearMotor } from "./devices/technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./devices/tiltsensor";
|
||||
import { TrainMotor } from "./devices/trainmotor";
|
||||
import { VoltageSensor } from "./devices/voltagesensor";
|
||||
import { TachoMotor } from "./devices/tachomotor";
|
||||
import { AbsoluteMotor } from "./devices/absolutemotor";
|
||||
import { BasicMotor } from "./devices/basicmotor";
|
||||
|
||||
import { isWebBluetooth } from "./utils";
|
||||
|
||||
@ -82,6 +85,9 @@ window.PoweredUP = {
|
||||
TrainMotor,
|
||||
VoltageSensor,
|
||||
CurrentSensor,
|
||||
TachoMotor,
|
||||
AbsoluteMotor,
|
||||
BasicMotor,
|
||||
isWebBluetooth
|
||||
};
|
||||
|
||||
|
@ -39,6 +39,9 @@ import { TechnicXLargeLinearMotor } from "./devices/technicxlargelinearmotor";
|
||||
import { TiltSensor } from "./devices/tiltsensor";
|
||||
import { TrainMotor } from "./devices/trainmotor";
|
||||
import { VoltageSensor } from "./devices/voltagesensor";
|
||||
import { TachoMotor } from "./devices/tachomotor";
|
||||
import { AbsoluteMotor } from "./devices/absolutemotor";
|
||||
import { BasicMotor } from "./devices/basicmotor";
|
||||
|
||||
import { isWebBluetooth } from "./utils";
|
||||
|
||||
@ -82,5 +85,8 @@ export {
|
||||
TrainMotor,
|
||||
VoltageSensor,
|
||||
CurrentSensor,
|
||||
TachoMotor,
|
||||
AbsoluteMotor,
|
||||
BasicMotor,
|
||||
isWebBluetooth
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import { EventEmitter } from "events";
|
||||
import { Device } from "./devices/device";
|
||||
|
||||
// @ts-ignore
|
||||
export const isWebBluetooth = (typeof navigator !== "undefined" && navigator && navigator.bluetooth);
|
||||
export const isWebBluetooth = !!(typeof navigator !== "undefined" && navigator && navigator.bluetooth);
|
||||
|
||||
export const toHex = (value: number, length: number = 2) => {
|
||||
return value.toString(16).padStart(length, "0");
|
||||
|
Loading…
x
Reference in New Issue
Block a user