references-empty.js 701 B

1234567891011121314151617
  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.referencesEmpty = void 0;
  7. const message_1 = __importDefault(require("@commitlint/message"));
  8. const referencesEmpty = (parsed, when = 'never') => {
  9. const negated = when === 'always';
  10. const notEmpty = parsed.references.length > 0;
  11. return [
  12. negated ? !notEmpty : notEmpty,
  13. (0, message_1.default)(['references', negated ? 'must' : 'may not', 'be empty']),
  14. ];
  15. };
  16. exports.referencesEmpty = referencesEmpty;
  17. //# sourceMappingURL=references-empty.js.map