UNPKG

906 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.subjectFullStop = void 0;
7const message_1 = __importDefault(require("@commitlint/message"));
8const 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};
21exports.subjectFullStop = subjectFullStop;
22//# sourceMappingURL=subject-full-stop.js.map
\No newline at end of file