Socket
Socket
Sign inDemoInstall

@commitlint/parse

Package Overview
Dependencies
79
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.1.2 to 7.3.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="7.3.0"></a>
# [7.3.0](https://github.com/marionebl/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11)
### Bug Fixes
* fall back to conventional commit-parser settings for missing keys ([#496](https://github.com/marionebl/commitlint/issues/496)) ([831a141](https://github.com/marionebl/commitlint/commit/831a141)), closes [#399](https://github.com/marionebl/commitlint/issues/399)
<a name="7.1.2"></a>

@@ -8,0 +19,0 @@ ## [7.1.2](https://github.com/marionebl/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)

35

lib/index.js

@@ -13,2 +13,4 @@ 'use strict';

var _lodash = require('lodash');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -21,25 +23,14 @@

return new Promise(function ($return, $error) {
var changelogOpts, parsed;
var defaultOpts, parsed;
return Promise.resolve(_conventionalChangelogAngular2.default).then(function ($await_1) {
try {
defaultOpts = $await_1.parserOpts;
parsed = parser(message, (0, _lodash.merge)({}, defaultOpts, parserOpts));
if (!parserOpts || Object.keys(parserOpts || {}).length === 0) {
return Promise.resolve(_conventionalChangelogAngular2.default).then(function ($await_2) {
try {
changelogOpts = $await_2;
parserOpts = changelogOpts.parserOpts;
return $If_1.call(this);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}
function $If_1() {
parsed = parser(message, parserOpts);
parsed.raw = message;
return $return(parsed);
}
return $If_1.call(this);
parsed.raw = message;
return $return(parsed);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this));

@@ -46,0 +37,0 @@ }

@@ -321,2 +321,89 @@ 'use strict';

}.bind(this)));
(0, _ava2.default)('uses permissive default regex without parser opts', t => new Promise(function ($return, $error) {
var message, actual;
message = 'chore(component,demo): bump';
return Promise.resolve((0, _2.default)(message)).then(function ($await_19) {
try {
actual = $await_19;
t.is(actual.scope, 'component,demo');
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this)));
(0, _ava2.default)('uses permissive default regex with other parser opts', t => new Promise(function ($return, $error) {
var message, actual;
message = 'chore(component,demo): bump';
return Promise.resolve((0, _2.default)(message, undefined, { commentChar: '#' })).then(function ($await_20) {
try {
actual = $await_20;
t.is(actual.scope, 'component,demo');
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this)));
(0, _ava2.default)('uses restrictive default regex in passed parser opts', t => new Promise(function ($return, $error) {
var message, actual;
message = 'chore(component,demo): bump';
return Promise.resolve((0, _2.default)(message, undefined, {
headerPattern: /^(\w*)(?:\(([a-z]*)\))?: (.*)$/
})).then(function ($await_21) {
try {
actual = $await_21;
t.is(actual.subject, null);
t.is(actual.scope, null);
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this)));
(0, _ava2.default)('works with chinese scope by default', t => new Promise(function ($return, $error) {
var message, actual;
message = 'fix(面试评价): 测试';
return Promise.resolve((0, _2.default)(message, undefined, { commentChar: '#' })).then(function ($await_22) {
try {
actual = $await_22;
t.not(actual.subject, null);
t.not(actual.scope, null);
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this)));
(0, _ava2.default)('does not work with chinese scopes with incompatible pattern', t => new Promise(function ($return, $error) {
var message, actual;
message = 'fix(面试评价): 测试';
return Promise.resolve((0, _2.default)(message, undefined, {
headerPattern: /^(\w*)(?:\(([a-z]*)\))?: (.*)$/
})).then(function ($await_23) {
try {
actual = $await_23;
t.is(actual.subject, null);
t.is(actual.scope, null);
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this)));
//# sourceMappingURL=index.test.js.map
{
"name": "@commitlint/parse",
"version": "7.1.2",
"version": "7.3.0",
"description": "Lint your commit messages",

@@ -62,7 +62,7 @@ "main": "lib/index.js",

"devDependencies": {
"@commitlint/test": "^7.1.2",
"@commitlint/utils": "^7.1.2",
"@commitlint/test": "^7.3.0",
"@commitlint/utils": "^7.3.0",
"ava": "0.22.0",
"babel-cli": "6.26.0",
"babel-preset-commitlint": "^7.1.2",
"babel-preset-commitlint": "^7.3.0",
"babel-register": "6.26.0",

@@ -77,4 +77,5 @@ "concurrently": "3.5.1",

"conventional-changelog-angular": "^1.3.3",
"conventional-commits-parser": "^2.1.0"
"conventional-commits-parser": "^2.1.0",
"lodash": "^4.17.11"
}
}

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc