()
| 933 | } |
| 934 | |
| 935 | toString(): string { |
| 936 | if (typeof this.host === 'string') { |
| 937 | if (this.isIPv6) { |
| 938 | return `[${this.host}]:${this.port}`; |
| 939 | } |
| 940 | return `${this.host}:${this.port}`; |
| 941 | } |
| 942 | return `${this.socketPath}`; |
| 943 | } |
| 944 | |
| 945 | static fromString(this: void, s: string): HostAddress { |
| 946 | return new HostAddress(s); |