UNPKG

@microsoft/dev-tunnels-connections

Version:

Tunnels library for Visual Studio tools

24 lines 840 B
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. Object.defineProperty(exports, "__esModule", { value: true }); exports.SessionPortKey = void 0; /** * Class for comparing equality in sessionId port pairs */ class SessionPortKey { constructor(sessionId, port) { this.sessionId = sessionId !== null && sessionId !== void 0 ? sessionId : null; this.port = port; } equals(other) { return this.port === other.port && ((!this.sessionId && !other.sessionId) || this.sessionId && other.sessionId && this.sessionId === other.sessionId); } toString() { return this.port + (this.sessionId ? '_' + this.sessionId.toString('base64') : ''); } } exports.SessionPortKey = SessionPortKey; //# sourceMappingURL=sessionPortKey.js.map