declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
17 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.evaluteProjectAgainstProjectCheckDeclaration = void 0;
const withDurationReporting_1 = require("../../../utils/wrappers/withDurationReporting");
const evaluateProjectAgainstFileCheckDeclaration_1 = require("./evaluateProjectAgainstFileCheckDeclaration");
const evaluteProjectAgainstProjectCheckDeclaration = async ({ practiceRef, purpose, project, declaration, }) => {
// evaluate each declared file check
const results = (await Promise.all(declaration.checks.map((check) => (0, withDurationReporting_1.withDurationReporting)(`evaluateFileCheckDeclaration.${practiceRef}.${check.pathGlob}`, () => (0, evaluateProjectAgainstFileCheckDeclaration_1.evaluateProjectAgainstFileCheckDeclaration)({
practiceRef,
project,
purpose,
check,
}))()))).flat(); // flatten, since each "FileCheckDeclaration" may actually apply to more than one file (since the check declarations reference a pathGlob -> glob can specify more than one file)
return results;
};
exports.evaluteProjectAgainstProjectCheckDeclaration = evaluteProjectAgainstProjectCheckDeclaration;
//# sourceMappingURL=evaluateProjectAgainstProjectCheckDeclaration.js.map