UNPKG

531 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.findFlowRoot = findFlowRoot;
7
8var _fileUtils = require("./fileUtils");
9
10var _node = require("./node");
11
12// Find the project root
13async function findFlowRoot(start) {
14 return (0, _fileUtils.searchUpDirPath)(start, async dirPath => {
15 const flowConfigPath = _node.path.join(dirPath, '.flowconfig');
16
17 try {
18 return _node.fs.statSync(flowConfigPath).isFile();
19 } catch (e) {
20 // Not a file...
21 return false;
22 }
23 });
24}
\No newline at end of file