"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=https://github.com/VSCodium/sourcemaps/releases/download/stable-4c0b0c6cc561d2d3636d1ec250935431876ce4dc/node_modules-@microsoft-dev-tunnels-connections-sessionPortKey.js.map