UNPKG

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