Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commitlint/rules

Package Overview
Dependencies
Maintainers
4
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/rules - npm Package Compare versions

Comparing version 18.4.3 to 18.4.4

28

lib/scope-enum.js

@@ -32,4 +32,4 @@ "use strict";

const message_1 = __importDefault(require("@commitlint/message"));
const scopeEnum = (parsed, when = 'always', value = []) => {
if (!parsed.scope) {
const scopeEnum = ({ scope }, when = 'always', value = []) => {
if (!scope || !value.length) {
return [true, ''];

@@ -40,16 +40,16 @@ }

const delimiters = /\/|\\|, ?/g;
const scopeSegments = parsed.scope.split(delimiters);
const negated = when === 'never';
const result = value.length === 0 ||
scopeSegments.every((scope) => ensure.enum(scope, value));
return [
negated ? !result : result,
(0, message_1.default)([
`scope must`,
negated ? `not` : null,
`be one of [${value.join(', ')}]`,
]),
];
const messageScopes = scope.split(delimiters);
const errorMessage = ['scope must', `be one of [${value.join(', ')}]`];
const isScopeInEnum = (scope) => ensure.enum(scope, value);
let isValid;
if (when === 'never') {
isValid = !messageScopes.some(isScopeInEnum);
errorMessage.splice(1, 0, 'not');
}
else {
isValid = messageScopes.every(isScopeInEnum);
}
return [isValid, (0, message_1.default)(errorMessage)];
};
exports.scopeEnum = scopeEnum;
//# sourceMappingURL=scope-enum.js.map

@@ -15,3 +15,6 @@ "use strict";

const negated = when === 'never';
const hasStop = input[input.length - 1] === value;
let hasStop = input[input.length - 1] === value;
if (input.slice(-3) === '...') {
hasStop = false;
}
return [

@@ -18,0 +21,0 @@ negated ? !hasStop : hasStop,

{
"name": "@commitlint/rules",
"version": "18.4.3",
"version": "18.4.4",
"description": "Lint your commit messages",

@@ -38,5 +38,5 @@ "main": "lib/index.js",

"devDependencies": {
"@commitlint/parse": "^18.4.3",
"@commitlint/parse": "^18.4.4",
"@commitlint/test": "^18.0.0",
"@commitlint/utils": "^18.4.3",
"@commitlint/utils": "^18.4.4",
"conventional-changelog-angular": "7.0.0",

@@ -46,9 +46,9 @@ "glob": "^8.0.3"

"dependencies": {
"@commitlint/ensure": "^18.4.3",
"@commitlint/message": "^18.4.3",
"@commitlint/to-lines": "^18.4.3",
"@commitlint/types": "^18.4.3",
"@commitlint/ensure": "^18.4.4",
"@commitlint/message": "^18.4.4",
"@commitlint/to-lines": "^18.4.4",
"@commitlint/types": "^18.4.4",
"execa": "^5.0.0"
},
"gitHead": "970b806bdd338e8b3e4529f21f20e795e66cd48f"
"gitHead": "ad2637f3cf23c5579e600950594e4d8d47d79864"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc