Projekt

Obecné

Profil

Stáhnout (570 Bajtů) Statistiky
| Větev: | Revize:
1
"use strict";
2

    
3
var path = require("path");
4
var exists = require("./utils/exists");
5

    
6
module.exports = function find(fileSystem, start) {
7
  var _arr = [".babelrc", "package.json"];
8

    
9
  for (var _i = 0; _i < _arr.length; _i++) {
10
    var fileName = _arr[_i];
11
    var file = path.join(start, fileName);
12

    
13
    if (exists(fileSystem, file)) {
14
      if (fileName !== "package.json" || typeof require(file).babel === "object") {
15
        return file;
16
      }
17
    }
18
  }
19

    
20
  var up = path.dirname(start);
21

    
22
  // Reached root
23
  if (up !== start) {
24
    return find(fileSystem, up);
25
  }
26
};
(3-3/3)