"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const Local_1 = require("../Local");
const Password_1 = __importDefault(require("../Password"));
const URI_1 = require("../utils/URI");
async function default_1(path) {
    if (!(0, Local_1.stat)(path)) {
        return null;
    }
    const config = JSON.parse(await (0, Local_1.read)(path));
    config.password = await Password_1.default.get((0, URI_1.connectionID)(config.scheme, config.user, config.host, config.port), true);
    return config;
}
