Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buttplug

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buttplug - npm Package Compare versions

Comparing version 3.0.0-alpha.3 to 3.0.0-alpha.4

2

dist/main/src/client/ButtplugClientDevice.d.ts

@@ -58,3 +58,5 @@ /*!

sensorRead(sensorIndex: number, sensorType: Messages.SensorType): Promise<number[]>;
get hasBattery(): boolean;
battery(): Promise<number>;
get hasRssi(): boolean;
rssi(): Promise<number>;

@@ -61,0 +63,0 @@ rawRead(endpoint: string, expectedLength: number, timeout: number): Promise<Uint8Array>;

18

dist/main/src/client/ButtplugClientDevice.js

@@ -228,9 +228,14 @@ /*!

}
get hasBattery() {
var _a;
const batteryAttrs = (_a = this.messageAttributes.SensorReadCmd) === null || _a === void 0 ? void 0 : _a.filter((x) => x.SensorType === Messages.SensorType.Battery);
return batteryAttrs !== undefined && batteryAttrs.length > 0;
}
battery() {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const batteryAttrs = (_a = this.messageAttributes.SensorReadCmd) === null || _a === void 0 ? void 0 : _a.filter((x) => x.SensorType === Messages.SensorType.Battery);
if (!batteryAttrs || batteryAttrs.length === 0) {
if (!this.hasBattery) {
throw new Exceptions_1.ButtplugDeviceException(`Device ${this.name} has no Battery capabilities`);
}
const batteryAttrs = (_a = this.messageAttributes.SensorReadCmd) === null || _a === void 0 ? void 0 : _a.filter((x) => x.SensorType === Messages.SensorType.Battery);
// Find the battery sensor, we'll need its index.

@@ -241,9 +246,14 @@ const result = yield this.sensorRead(batteryAttrs[0].Index, Messages.SensorType.Battery);

}
get hasRssi() {
var _a;
const rssiAttrs = (_a = this.messageAttributes.SensorReadCmd) === null || _a === void 0 ? void 0 : _a.filter((x) => x.SensorType === Messages.SensorType.RSSI);
return rssiAttrs !== undefined && rssiAttrs.length === 0;
}
rssi() {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const rssiAttrs = (_a = this.messageAttributes.SensorReadCmd) === null || _a === void 0 ? void 0 : _a.filter((x) => x.SensorType === Messages.SensorType.RSSI);
if (!rssiAttrs || rssiAttrs.length === 0) {
if (!this.hasRssi) {
throw new Exceptions_1.ButtplugDeviceException(`Device ${this.name} has no RSSI capabilities`);
}
const rssiAttrs = (_a = this.messageAttributes.SensorReadCmd) === null || _a === void 0 ? void 0 : _a.filter((x) => x.SensorType === Messages.SensorType.RSSI);
// Find the battery sensor, we'll need its index.

@@ -250,0 +260,0 @@ const result = yield this.sensorRead(rssiAttrs[0].Index, Messages.SensorType.RSSI);

{
"name": "buttplug",
"version": "3.0.0-alpha.3",
"version": "3.0.0-alpha.4",
"description": "Buttplug Client Implementation for Typescript/Javascript",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/buttplugio/buttplug-js/",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc