UNPKG

940 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.subjectExclamationMark = void 0;
7const message_1 = __importDefault(require("@commitlint/message"));
8const subjectExclamationMark = (parsed, when = 'always') => {
9 const input = parsed.header;
10 if (!input) {
11 return [true, ''];
12 }
13 const negated = when === 'never';
14 const hasExclamationMark = /!:/.test(input);
15 return [
16 negated ? !hasExclamationMark : hasExclamationMark,
17 message_1.default([
18 'subject',
19 negated ? 'must not' : 'must',
20 'have an exclamation mark in the subject to identify a breaking change',
21 ]),
22 ];
23};
24exports.subjectExclamationMark = subjectExclamationMark;
25//# sourceMappingURL=subject-exclamation-mark.js.map
\No newline at end of file