conventional-commits-filter
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.1.1"></a> | ||
## [1.1.1](https://github.com/stevemao/conventional-commits-filter/compare/conventional-commits-filter@1.1.0...conventional-commits-filter@1.1.1) (2017-12-08) | ||
### Bug Fixes | ||
* **filter:** only remove commits that reverted commits in the scope ([#226](https://github.com/stevemao/conventional-commits-filter/issues/226)) ([461dae6](https://github.com/stevemao/conventional-commits-filter/commit/461dae6)) | ||
<a name="1.1.0"></a> | ||
@@ -8,0 +19,0 @@ # 1.1.0 (2017-11-13) |
22
index.js
@@ -20,10 +20,12 @@ 'use strict'; | ||
var ignores = []; | ||
var remove = []; | ||
commits.forEach(function (commit) { | ||
if (commit.revert) { | ||
ignores.push(commit.revert); | ||
} else { | ||
ret.push(commit); | ||
ignores.push(commit); | ||
} | ||
ret.push(commit); | ||
}); | ||
// Filter out reverted commits | ||
ret = ret.filter(function (commit) { | ||
@@ -34,6 +36,11 @@ var ignoreThis = false; | ||
ignores.some(function (ignore) { | ||
ignore = modifyValues(ignore, modifyValue); | ||
ignores.some(function (ignoreCommit) { | ||
var ignore = modifyValues(ignoreCommit.revert, modifyValue); | ||
ignoreThis = isSubset(commit, ignore); | ||
if (ignoreThis) { | ||
remove.push(ignoreCommit.hash); | ||
} | ||
return ignoreThis; | ||
@@ -45,2 +52,7 @@ }); | ||
// Filter out the commits that reverted something otherwise keep the revert commits | ||
ret = ret.filter(function (commit) { | ||
return remove.indexOf(commit.hash) !== 0; | ||
}); | ||
return ret; | ||
@@ -47,0 +59,0 @@ } |
{ | ||
"name": "conventional-commits-filter", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Filter out reverted commits parsed by conventional-commits-parser", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/stevemao/conventional-commits-filter", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8525
43
1