"use strict";
const osHomedir = require('os-homedir');
const path = require('path');
function expandTilde(filepath) {
    const home = getHomedir();
    if (filepath.indexOf('~/') !== 0) {
        return filepath;
    }
    return path.resolve(home, filepath.substr(2));
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = expandTilde;
function getHomedir() {
    const home = osHomedir();
    if (!home)
        throw new Error('Could not find the homedir');
    return home;
}
//# sourceMappingURL=expandTilde.js.map