/usr/lib/nodejs/babel-loader/lib/resolve-rc.js is in node-babel-loader 7.1.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | "use strict";
const path = require("path");
const exists = require("./utils/exists");
module.exports = function find(fileSystem, start) {
for (const fileName of [".babelrc", ".babelrc.js", "package.json"]) {
const file = path.join(start, fileName);
if (exists(fileSystem, file)) {
if (fileName !== "package.json" || typeof require(file).babel === "object") {
return file;
}
}
}
const up = path.dirname(start);
// Reached root
if (up !== start) {
return find(fileSystem, up);
}
};
|