Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(device: HIDDevice) {
super();
this.device = device;
this.deviceModel = identifyUSBProductId(device.productId);
device.addEventListener("inputreport", this.onInputReport);
}
device => {
if (!unsubscribed) {
const deviceModel = identifyUSBProductId(device.productId);
observer.next({ type: "add", descriptor: device, deviceModel });
observer.complete();
}
},
error => {
devices.map(device => ({
type: "add",
descriptor: device,
deviceModel: identifyUSBProductId(device.productId)
}))
)
const onAdd = device => {
const deviceModel = identifyUSBProductId(device.productId);
observer.next({
type: "add",
descriptor: "",
deviceModel,
device: { name: device.deviceName }
});
};
const onAdd = device => {
if (unsubscribed || !device) return;
const deviceModel = identifyUSBProductId(device.productId);
observer.next({
type: "add",
descriptor: device.path,
deviceModel,
device
});
};
const onRemove = device => {
getDevices().forEach(device => {
const deviceModel = identifyUSBProductId(device.productId);
observer.next({
type: "add",
descriptor: device.path,
deviceModel,
device
});
});
observer.complete();
device => {
if (!unsubscribed) {
const deviceModel = identifyUSBProductId(device.productId);
observer.next({ type: "add", descriptor: device, deviceModel });
observer.complete();
}
},
error => {
constructor(device: USBDevice, interfaceNumber: number) {
super();
this.device = device;
this.interfaceNumber = interfaceNumber;
this.deviceModel = identifyUSBProductId(device.productId);
}