conventional-commits-parser 3.2.0 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +2 -1
- package/index.js +1 -1
- package/lib/parser.js +17 -2
- package/package.json +5 -7
package/CHANGELOG.md
CHANGED
|
@@ -37,6 +37,34 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
### [3.2.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.3...conventional-commits-parser-v3.2.4) (2021-12-29)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* support BREAKING-CHANGE alongside BREAKING CHANGE ([#882](https://github.com/conventional-changelog/conventional-changelog/issues/882)) ([e6f44ad](https://github.com/conventional-changelog/conventional-changelog/commit/e6f44adcf1ac5abbb85bdac73237c331c6594177))
|
|
46
|
+
|
|
47
|
+
### [3.2.3](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.2...conventional-commits-parser-v3.2.3) (2021-10-23)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* address ReDoS issue ([#861](https://www.github.com/conventional-changelog/conventional-changelog/issues/861)) ([c696fa3](https://www.github.com/conventional-changelog/conventional-changelog/commit/c696fa35f93e0ee13728d6cf1221587ac6386311))
|
|
53
|
+
|
|
54
|
+
### [3.2.2](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.1...conventional-commits-parser-v3.2.2) (2021-09-09)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### Bug Fixes
|
|
58
|
+
|
|
59
|
+
* **conventional-commits-parser:** address CVE-2021-23425 ([#841](https://www.github.com/conventional-changelog/conventional-changelog/issues/841)) ([02b3d53](https://www.github.com/conventional-changelog/conventional-changelog/commit/02b3d53a0c142f0c28ee7d190d210c76a62887c2))
|
|
60
|
+
|
|
61
|
+
### [3.2.1](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.2.0...v3.2.1) (2021-02-15)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Bug Fixes
|
|
65
|
+
|
|
66
|
+
* handle missing header in merge commit ([#757](https://www.github.com/conventional-changelog/conventional-changelog/issues/757)) ([d189d3e](https://www.github.com/conventional-changelog/conventional-changelog/commit/d189d3e45b82e7141115ce8eccd95c8cf2d7db77))
|
|
67
|
+
|
|
40
68
|
## [3.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.7...conventional-commits-parser@3.0.8) (2019-11-14)
|
|
41
69
|
|
|
42
70
|
|
package/README.md
CHANGED
|
@@ -201,7 +201,8 @@ Used to define if `issuePrefixes` should be considered case sensitive.
|
|
|
201
201
|
|
|
202
202
|
##### noteKeywords
|
|
203
203
|
|
|
204
|
-
Type: `array` of `string` or `string` Default: `['BREAKING CHANGE'
|
|
204
|
+
Type: `array` of `string` or `string` Default: `['BREAKING CHANGE',
|
|
205
|
+
'BREAKING-CHANGE']`
|
|
205
206
|
|
|
206
207
|
Keywords for important notes. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
|
|
207
208
|
|
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ function assignOpts (options) {
|
|
|
21
21
|
'resolved'
|
|
22
22
|
],
|
|
23
23
|
issuePrefixes: ['#'],
|
|
24
|
-
noteKeywords: ['BREAKING CHANGE'],
|
|
24
|
+
noteKeywords: ['BREAKING CHANGE', 'BREAKING-CHANGE'],
|
|
25
25
|
fieldPattern: /^-(.*?)-$/,
|
|
26
26
|
revertPattern: /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./,
|
|
27
27
|
revertCorrespondence: ['header', 'hash'],
|
package/lib/parser.js
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
const trimOffNewlines = require('trim-off-newlines')
|
|
3
2
|
const _ = require('lodash')
|
|
4
3
|
|
|
5
4
|
const CATCH_ALL = /()(.+)/gi
|
|
6
5
|
const SCISSOR = '# ------------------------ >8 ------------------------'
|
|
7
6
|
|
|
7
|
+
function trimOffNewlines (input) {
|
|
8
|
+
const result = input.match(/[^\r\n]/)
|
|
9
|
+
if (!result) {
|
|
10
|
+
return ''
|
|
11
|
+
}
|
|
12
|
+
const firstIndex = result.index
|
|
13
|
+
let lastIndex = input.length - 1
|
|
14
|
+
while (input[lastIndex] === '\r' || input[lastIndex] === '\n') {
|
|
15
|
+
lastIndex--
|
|
16
|
+
}
|
|
17
|
+
return input.substring(firstIndex, lastIndex + 1)
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
function append (src, line) {
|
|
9
21
|
if (src) {
|
|
10
22
|
src += '\n' + line
|
|
@@ -147,9 +159,12 @@ function parser (raw, options, regex) {
|
|
|
147
159
|
merge = mergeMatch[0]
|
|
148
160
|
|
|
149
161
|
header = lines.shift()
|
|
150
|
-
while (!header.trim()) {
|
|
162
|
+
while (header !== undefined && !header.trim()) {
|
|
151
163
|
header = lines.shift()
|
|
152
164
|
}
|
|
165
|
+
if (!header) {
|
|
166
|
+
header = ''
|
|
167
|
+
}
|
|
153
168
|
|
|
154
169
|
_.forEach(mergeCorrespondence, function (partName, index) {
|
|
155
170
|
const partValue = mergeMatch[index + 1] || null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conventional-commits-parser",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Parse raw conventional commits",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
|
|
@@ -33,13 +33,12 @@
|
|
|
33
33
|
"logs"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"JSONStream": "^1.0.4",
|
|
37
36
|
"is-text-path": "^1.0.1",
|
|
37
|
+
"JSONStream": "^1.0.4",
|
|
38
38
|
"lodash": "^4.17.15",
|
|
39
39
|
"meow": "^8.0.0",
|
|
40
|
-
"split2": "^
|
|
41
|
-
"through2": "^4.0.0"
|
|
42
|
-
"trim-off-newlines": "^1.0.0"
|
|
40
|
+
"split2": "^3.0.0",
|
|
41
|
+
"through2": "^4.0.0"
|
|
43
42
|
},
|
|
44
43
|
"scripts": {
|
|
45
44
|
"test-windows": "echo 'make work on windows'"
|
|
@@ -49,6 +48,5 @@
|
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
50
|
"forceable-tty": "^0.1.0"
|
|
52
|
-
}
|
|
53
|
-
"gitHead": "cc567b98facf71315f4b1620d81ce01d155efaca"
|
|
51
|
+
}
|
|
54
52
|
}
|