declapract
Version:
A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.
12 lines • 489 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withOptionalityCheck = void 0;
const withOptionalityCheck = (logic) => {
return async (foundContents, context) => {
if (!context.required && foundContents === null)
return; // if this file is optional, then just return here
await logic(foundContents, context);
};
};
exports.withOptionalityCheck = withOptionalityCheck;
//# sourceMappingURL=withOptionalityCheck.js.map