conventional-commits-parser
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -0,1 +1,11 @@ | ||
<a name="0.1.2"></a> | ||
## [0.1.2](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.1...v0.1.2) (2015-09-18) | ||
### Bug Fixes | ||
* **parser:** do not trim spaces but newlines ([62e7bf5](https://github.com/stevemao/conventional-commits-parser/commit/62e7bf5)) | ||
<a name="0.1.1"></a> | ||
@@ -2,0 +12,0 @@ ## [0.1.1](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.0...v0.1.1) (2015-09-12) |
'use strict'; | ||
var trimOffNewlines = require('trim-off-newlines'); | ||
var _ = require('lodash'); | ||
@@ -33,3 +34,3 @@ | ||
var otherFields = {}; | ||
var lines = raw.trim().split('\n'); | ||
var lines = trimOffNewlines(raw).split('\n'); | ||
var continueNote = false; | ||
@@ -210,3 +211,3 @@ var isBody = true; | ||
_.map(notes, function(note) { | ||
note.text = note.text.trim(); | ||
note.text = trimOffNewlines(note.text); | ||
@@ -218,4 +219,4 @@ return note; | ||
header: header, | ||
body: body ? body.trim() : null, | ||
footer: footer ? footer.trim() : null, | ||
body: body ? trimOffNewlines(body) : null, | ||
footer: footer ? trimOffNewlines(footer) : null, | ||
notes: notes, | ||
@@ -222,0 +223,0 @@ references: references, |
{ | ||
"name": "conventional-commits-parser", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Parse raw conventional commits", | ||
@@ -27,3 +27,4 @@ "homepage": "https://github.com/stevemao/conventional-commits-parser", | ||
"split": "^1.0.0", | ||
"through2": "^2.0.0" | ||
"through2": "^2.0.0", | ||
"trim-off-newlines": "^1.0.0" | ||
}, | ||
@@ -30,0 +31,0 @@ "devDependencies": { |
@@ -219,3 +219,3 @@ 'use strict'; | ||
revertPattern: '^Revert\\s"([\\s\\S]*)"\\s*This reverts commit (\\w*)\\.', | ||
revertCorrespondence: 'header' | ||
revertCorrespondence: ' header' | ||
})) | ||
@@ -222,0 +222,0 @@ .pipe(through.obj(function(chunk, enc, cb) { |
@@ -141,2 +141,38 @@ 'use strict'; | ||
it('should keep spaces', function() { | ||
expect(parser( | ||
' feat(scope): broadcast $destroy event on scope destruction \n' + | ||
' perf testing shows that in chrome this change adds 5-15% overhead \n\n' + | ||
' when destroying 10k nested scopes where each scope has a $destroy listener \n' + | ||
' BREAKING AMEND: some breaking change \n\n' + | ||
' BREAKING AMEND: An awesome breaking change\n\n\n```\ncode here\n```' + | ||
'\n\n Kills #1\n', | ||
options, | ||
reg | ||
)).to.eql({ | ||
header: ' feat(scope): broadcast $destroy event on scope destruction ', | ||
body: ' perf testing shows that in chrome this change adds 5-15% overhead \n\n when destroying 10k nested scopes where each scope has a $destroy listener ', | ||
footer: ' BREAKING AMEND: some breaking change \n\n BREAKING AMEND: An awesome breaking change\n\n\n```\ncode here\n```\n\n Kills #1', | ||
notes: [{ | ||
title: 'BREAKING AMEND', | ||
text: 'some breaking change ' | ||
}, { | ||
title: 'BREAKING AMEND', | ||
text: 'An awesome breaking change\n\n\n```\ncode here\n```' | ||
}], | ||
references: [{ | ||
action: 'Kills', | ||
owner: null, | ||
repository: null, | ||
issue: '1', | ||
raw: '#1', | ||
prefix: '#' | ||
}], | ||
revert: null, | ||
scope: null, | ||
subject: null, | ||
type: null | ||
}); | ||
}); | ||
describe('header', function() { | ||
@@ -143,0 +179,0 @@ it('should allow ":" in scope', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61416
1434
7
+ Addedtrim-off-newlines@^1.0.0
+ Addedtrim-off-newlines@1.0.3(transitive)