flow-typed
Version:
A repository of high quality flow type definitions
24 lines (19 loc) • 531 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findFlowRoot = findFlowRoot;
var _fileUtils = require("./fileUtils");
var _node = require("./node");
// Find the project root
async function findFlowRoot(start) {
return (0, _fileUtils.searchUpDirPath)(start, async dirPath => {
const flowConfigPath = _node.path.join(dirPath, '.flowconfig');
try {
return _node.fs.statSync(flowConfigPath).isFile();
} catch (e) {
// Not a file...
return false;
}
});
}
;