Skip to content

Commit 57a955f

Browse files
committed
Use test instead of exec
1 parent c709f8e commit 57a955f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/serial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Serial extends EventTarget {
123123
if (portPath === "virtual") {
124124
console.log(`${this.logHead} Using virtual protocol (based on port path)`);
125125
newProtocol = this._virtual;
126-
} else if (portPath === "manual" || /^(tcp|ws):\/\/([A-Za-z0-9.-]+)(?::(\d+))?$/.exec(portPath)) {
126+
} else if (portPath === "manual" || /^(tcp|ws):\/\/([A-Za-z0-9.-]+)(?::(\d+))?$/.test(portPath)) {
127127
console.log(`${this.logHead} Using websocket protocol (based on port path)`);
128128
newProtocol = this._webSocket;
129129
} else if (portPath.startsWith("bluetooth")) {

0 commit comments

Comments
 (0)