@commitlint/parse
Advanced tools
Comparing version 7.5.0 to 7.6.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06) | ||
### Bug Fixes | ||
* don't merge array properties with custom opts ([#616](https://github.com/conventional-changelog/commitlint/issues/616)) ([f321647](https://github.com/conventional-changelog/commitlint/commit/f321647)), closes [#594](https://github.com/conventional-changelog/commitlint/issues/594) | ||
<a name="7.5.0"></a> | ||
@@ -8,0 +19,0 @@ # [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31) |
@@ -26,3 +26,5 @@ 'use strict'; | ||
defaultOpts = $await_1.parserOpts; | ||
parsed = parser(message, (0, _lodash.merge)({}, defaultOpts, parserOpts)); | ||
parsed = parser(message, (0, _lodash.mergeWith)({}, defaultOpts, parserOpts, (objValue, srcValue) => { | ||
if ((0, _lodash.isArray)(objValue)) return srcValue; | ||
})); | ||
@@ -29,0 +31,0 @@ parsed.raw = message; |
@@ -189,8 +189,39 @@ 'use strict'; | ||
(0, _ava2.default)('does not merge array properties with custom opts', t => new Promise(function ($return, $error) { | ||
var message, actual, expected; | ||
message = 'type: subject'; | ||
return Promise.resolve((0, _2.default)(message, undefined, { | ||
headerPattern: /^(.*):\s(.*)$/, | ||
headerCorrespondence: ['type', 'subject'] | ||
})).then(function ($await_10) { | ||
try { | ||
actual = $await_10; | ||
expected = { | ||
body: null, | ||
footer: null, | ||
header: 'type: subject', | ||
mentions: [], | ||
merge: null, | ||
notes: [], | ||
raw: 'type: subject', | ||
references: [], | ||
revert: null, | ||
subject: 'subject', | ||
type: 'type' | ||
}; | ||
t.deepEqual(actual, expected); | ||
return $return(); | ||
} catch ($boundEx) { | ||
return $error($boundEx); | ||
} | ||
}.bind(this), $error); | ||
}.bind(this))); | ||
(0, _ava2.default)('supports scopes with /', t => new Promise(function ($return, $error) { | ||
var message, actual; | ||
message = 'type(some/scope): subject'; | ||
return Promise.resolve((0, _2.default)(message)).then(function ($await_10) { | ||
return Promise.resolve((0, _2.default)(message)).then(function ($await_11) { | ||
try { | ||
actual = $await_10; | ||
actual = $await_11; | ||
@@ -209,5 +240,5 @@ t.is(actual.scope, 'some/scope'); | ||
message = 'type(some/scope): subject'; | ||
return Promise.resolve((0, _2.default)(message, undefined, {})).then(function ($await_11) { | ||
return Promise.resolve((0, _2.default)(message, undefined, {})).then(function ($await_12) { | ||
try { | ||
actual = $await_11; | ||
actual = $await_12; | ||
@@ -226,11 +257,11 @@ t.is(actual.scope, 'some/scope'); | ||
message = 'type(some/scope): subject\n# some comment'; | ||
return Promise.resolve((0, _importFrom2.default)(process.cwd(), 'conventional-changelog-angular')).then(function ($await_12) { | ||
return Promise.resolve((0, _importFrom2.default)(process.cwd(), 'conventional-changelog-angular')).then(function ($await_13) { | ||
try { | ||
changelogOpts = $await_12; | ||
changelogOpts = $await_13; | ||
opts = Object.assign({}, changelogOpts.parserOpts, { | ||
commentChar: '#' | ||
}); | ||
return Promise.resolve((0, _2.default)(message, undefined, opts)).then(function ($await_13) { | ||
return Promise.resolve((0, _2.default)(message, undefined, opts)).then(function ($await_14) { | ||
try { | ||
actual = $await_13; | ||
actual = $await_14; | ||
@@ -254,11 +285,11 @@ t.is(actual.body, null); | ||
message = 'type(some/scope): subject #reference\n# some comment\nthings #reference'; | ||
return Promise.resolve((0, _importFrom2.default)(process.cwd(), 'conventional-changelog-angular')).then(function ($await_14) { | ||
return Promise.resolve((0, _importFrom2.default)(process.cwd(), 'conventional-changelog-angular')).then(function ($await_15) { | ||
try { | ||
changelogOpts = $await_14; | ||
changelogOpts = $await_15; | ||
opts = Object.assign({}, changelogOpts.parserOpts, { | ||
commentChar: '#' | ||
}); | ||
return Promise.resolve((0, _2.default)(message, undefined, opts)).then(function ($await_15) { | ||
return Promise.resolve((0, _2.default)(message, undefined, opts)).then(function ($await_16) { | ||
try { | ||
actual = $await_15; | ||
actual = $await_16; | ||
@@ -282,8 +313,8 @@ t.is(actual.subject, 'subject #reference'); | ||
message = '#1 some subject'; | ||
return Promise.resolve((0, _importFrom2.default)(process.cwd(), 'conventional-changelog-angular')).then(function ($await_16) { | ||
return Promise.resolve((0, _importFrom2.default)(process.cwd(), 'conventional-changelog-angular')).then(function ($await_17) { | ||
try { | ||
opts = $await_16; | ||
return Promise.resolve((0, _2.default)(message, undefined, opts)).then(function ($await_17) { | ||
opts = $await_17; | ||
return Promise.resolve((0, _2.default)(message, undefined, opts)).then(function ($await_18) { | ||
try { | ||
_ref = $await_17, _ref$references = (0, _slicedToArray3.default)(_ref.references, 1); | ||
_ref = $await_18, _ref$references = (0, _slicedToArray3.default)(_ref.references, 1); | ||
actual = _ref$references[0]; | ||
@@ -309,5 +340,5 @@ | ||
issuePrefixes: ['PREFIX-'] | ||
})).then(function ($await_18) { | ||
})).then(function ($await_19) { | ||
try { | ||
_ref2 = $await_18; | ||
_ref2 = $await_19; | ||
references = _ref2.references; | ||
@@ -335,5 +366,5 @@ | ||
message = 'chore(component,demo): bump'; | ||
return Promise.resolve((0, _2.default)(message)).then(function ($await_19) { | ||
return Promise.resolve((0, _2.default)(message)).then(function ($await_20) { | ||
try { | ||
actual = $await_19; | ||
actual = $await_20; | ||
@@ -352,5 +383,5 @@ | ||
message = 'chore(component,demo): bump'; | ||
return Promise.resolve((0, _2.default)(message, undefined, { commentChar: '#' })).then(function ($await_20) { | ||
return Promise.resolve((0, _2.default)(message, undefined, { commentChar: '#' })).then(function ($await_21) { | ||
try { | ||
actual = $await_20; | ||
actual = $await_21; | ||
@@ -371,5 +402,5 @@ | ||
headerPattern: /^(\w*)(?:\(([a-z]*)\))?: (.*)$/ | ||
})).then(function ($await_21) { | ||
})).then(function ($await_22) { | ||
try { | ||
actual = $await_21; | ||
actual = $await_22; | ||
@@ -389,5 +420,5 @@ | ||
message = 'fix(面试评价): 测试'; | ||
return Promise.resolve((0, _2.default)(message, undefined, { commentChar: '#' })).then(function ($await_22) { | ||
return Promise.resolve((0, _2.default)(message, undefined, { commentChar: '#' })).then(function ($await_23) { | ||
try { | ||
actual = $await_22; | ||
actual = $await_23; | ||
@@ -409,5 +440,5 @@ | ||
headerPattern: /^(\w*)(?:\(([a-z]*)\))?: (.*)$/ | ||
})).then(function ($await_23) { | ||
})).then(function ($await_24) { | ||
try { | ||
actual = $await_23; | ||
actual = $await_24; | ||
@@ -414,0 +445,0 @@ |
{ | ||
"name": "@commitlint/parse", | ||
"version": "7.5.0", | ||
"version": "7.6.0", | ||
"description": "Lint your commit messages", | ||
@@ -11,3 +11,2 @@ "main": "lib/index.js", | ||
"build": "cross-env NODE_ENV=production babel src --out-dir lib --source-maps", | ||
"clean": "npx rimraf lib", | ||
"deps": "dep-check", | ||
@@ -61,12 +60,11 @@ "pkg": "pkg-check", | ||
"devDependencies": { | ||
"@commitlint/test": "^7.5.0", | ||
"@commitlint/utils": "^7.5.0", | ||
"@commitlint/test": "^7.6.0", | ||
"@commitlint/utils": "^7.6.0", | ||
"ava": "0.22.0", | ||
"babel-cli": "6.26.0", | ||
"babel-preset-commitlint": "^7.5.0", | ||
"babel-preset-commitlint": "^7.6.0", | ||
"babel-register": "6.26.0", | ||
"concurrently": "3.5.1", | ||
"cross-env": "5.1.1", | ||
"import-from": "2.1.0", | ||
"rimraf": "2.6.1" | ||
"import-from": "3.0.0" | ||
}, | ||
@@ -73,0 +71,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34992
9
414