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.bodyFullStop = void 0;
|
7 | const message_1 = __importDefault(require("@commitlint/message"));
|
8 | const 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 | };
|
20 | exports.bodyFullStop = bodyFullStop;
|
21 |
|
\ | No newline at end of file |