@deepkit/app
Version:
Deepkit App, CLI framework and service container
19 lines • 808 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.findParentPath = findParentPath;
const core_1 = require("@deepkit/core");
const fs_1 = require("fs");
const path_1 = require("path");
function findParentPath(path, origin = (0, path_1.dirname)((0, core_1.getCurrentFileName)())) {
let current = origin;
while (!(0, fs_1.existsSync)((0, path_1.join)(current, path))) {
const nextFolder = (0, path_1.resolve)(current, '..');
if (nextFolder === current) {
return undefined;
}
current = nextFolder;
}
return (0, path_1.join)(current, path);
}
findParentPath.__type = ['path', 'origin', () => (0, path_1.dirname)((0, core_1.getCurrentFileName)()), 'findParentPath', 'P&2!&2">#P&-J/$'];
//# sourceMappingURL=utils.js.map
;