declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
26 lines • 1.97 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.evaluteProjectAgainstProjectCheckDeclaration = void 0;
const withDurationReporting_1 = require("../../../utils/wrappers/withDurationReporting");
const evaluateProjectAgainstFileCheckDeclaration_1 = require("./evaluateProjectAgainstFileCheckDeclaration");
const evaluteProjectAgainstProjectCheckDeclaration = (_a) => __awaiter(void 0, [_a], void 0, function* ({ practiceRef, purpose, project, declaration, }) {
// evaluate each declared file check
const results = (yield 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
;