declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
23 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.containsCheck = void 0;
const checkContainsJSON_1 = require("./composableActions/checkContainsJSON");
const checkContainsSubstring_1 = require("./composableActions/checkContainsSubstring");
const checkExists_1 = require("./composableActions/checkExists");
const withOptionalityCheck_1 = require("./withOptionalityCheck");
exports.containsCheck = (0, withOptionalityCheck_1.withOptionalityCheck)(async (foundContents, context) => {
(0, checkExists_1.checkExists)(foundContents);
if (context.relativeFilePath.endsWith('.json')) {
(0, checkContainsJSON_1.checkContainsJSON)({
declaredContents: context.declaredFileContents,
foundContents: foundContents,
});
}
else {
(0, checkContainsSubstring_1.checkContainsSubstring)({
declaredContents: context.declaredFileContents,
foundContents: foundContents,
});
}
});
//# sourceMappingURL=containsCheck.js.map