We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is
1 parent dfed235 commit 2f3fe27Copy full SHA for 2f3fe27
arduino-ide-extension/src/common/protocol/boards-service.ts
@@ -94,6 +94,10 @@ export namespace Port {
94
}
95
96
97
+ export function is(arg: any): arg is Port {
98
+ return !!arg && 'address' in arg && typeof arg['address'] === 'string' && 'protocol' in arg && typeof arg['protocol'] === 'string';
99
+ }
100
+
101
export function toString(port: Port, options: { useLabel: boolean } = { useLabel: false }): string {
102
if (options.useLabel && port.label) {
103
return `${port.address} ${port.label}`
0 commit comments