"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const fs_1 = __importDefault(require("fs"));
const rootPath = {
    path: findRootPath(__dirname),
};
function findRootPath(dir) {
    const filePath = path_1.default.join(dir, 'package.json');
    if (fs_1.default.existsSync(filePath)) {
        return path_1.default.dirname(filePath);
    }
    const parentDir = path_1.default.dirname(dir);
    if (dir === parentDir) {
        return '';
    }
    return findRootPath(parentDir);
}
exports.default = rootPath;
//# sourceMappingURL=rootPath.js.map