Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
openHandlers.push(id => {
if (id.startsWith("usb|")) {
const json = JSON.parse(id.slice(4));
// $FlowFixMe: we should have concept of id in HIDTransport
return HIDTransport.open(json);
}
return null;
});
observables.push(hidObservable);
discovery: Observable.create(o => HIDTransport.listen(o)).pipe(
map(({ type, descriptor, deviceModel }) => {
const hidObservable = Observable.create(o => HIDTransport.listen(o)).pipe(
map(({ type, descriptor }) => ({
return retry(() => HIDTransport.open(devicePath), { maxRetry: 2 });
}