allow case insensitive port names
This commit is contained in:
parent
9a9d3ee4d5
commit
0b1c5008f3
10
src/hub.ts
10
src/hub.ts
@ -354,11 +354,13 @@ export class Hub extends EventEmitter {
|
||||
}
|
||||
|
||||
|
||||
protected _portLookup (port: string) {
|
||||
if (!this._ports[port.toUpperCase()] && !this._virtualPorts[port.toUpperCase()]) {
|
||||
throw new Error(`Port ${port.toUpperCase()} does not exist on this Hub type`);
|
||||
protected _portLookup (portName: string) {
|
||||
const portNameUpper = portName.toUpperCase();
|
||||
const port = this._ports[portNameUpper] || this._virtualPorts[portNameUpper];
|
||||
if (!port) {
|
||||
throw new Error(`Port ${portNameUpper} does not exist on this Hub type`);
|
||||
}
|
||||
return this._ports[port] || this._virtualPorts[port];
|
||||
return port;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user