mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-06 08:58:32 +00:00
@@ -94,6 +94,10 @@ export namespace Port {
|
||||
}
|
||||
}
|
||||
|
||||
export function is(arg: any): arg is Port {
|
||||
return !!arg && 'address' in arg && typeof arg['address'] === 'string' && 'protocol' in arg && typeof arg['protocol'] === 'string';
|
||||
}
|
||||
|
||||
export function toString(port: Port, options: { useLabel: boolean } = { useLabel: false }): string {
|
||||
if (options.useLabel && port.label) {
|
||||
return `${port.address} ${port.label}`
|
||||
|
||||
Reference in New Issue
Block a user