codeowners-api
Version:
Simple module to interact with github codeowners
18 lines (17 loc) • 458 B
JavaScript
;
exports.__esModule = true;
var ignore = require("ignore");
var hasMatch = function (mappedFile, codeOwners, path) {
var match = mappedFile
.slice()
.reverse()
.find(function (x) {
return ignore()
.add(x.path)
.ignores(path);
});
if (!match)
return false;
return match.owners.some(function (o) { return codeOwners.includes(o); });
};
exports["default"] = hasMatch;