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.subjectFullStop = void 0;
|
7 | const message_1 = __importDefault(require("@commitlint/message"));
|
8 | const subjectFullStop = (parsed, when = 'always', value = '.') => {
|
9 | const colonIndex = parsed.header.indexOf(':');
|
10 | if (colonIndex > 0 && colonIndex === parsed.header.length - 1) {
|
11 | return [true];
|
12 | }
|
13 | const input = parsed.header;
|
14 | const negated = when === 'never';
|
15 | const hasStop = input[input.length - 1] === value;
|
16 | return [
|
17 | negated ? !hasStop : hasStop,
|
18 | (0, message_1.default)(['subject', negated ? 'may not' : 'must', 'end with full stop']),
|
19 | ];
|
20 | };
|
21 | exports.subjectFullStop = subjectFullStop;
|
22 |
|
\ | No newline at end of file |