header-full-stop.js 751 B

123456789101112131415161718
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. exports.headerFullStop = void 0;
  7. const message_1 = __importDefault(require("@commitlint/message"));
  8. const headerFullStop = (parsed, when = 'always', value = '.') => {
  9. const { header } = parsed;
  10. const negated = when === 'never';
  11. const hasStop = header[header.length - 1] === value;
  12. return [
  13. negated ? !hasStop : hasStop,
  14. (0, message_1.default)(['header', negated ? 'may not' : 'must', 'end with full stop']),
  15. ];
  16. };
  17. exports.headerFullStop = headerFullStop;
  18. //# sourceMappingURL=header-full-stop.js.map