Skip to content

Commit 6e1e853

Browse files
committed
ifix: resolve immutable commit object error in transform function
Copy commit object before modification to avoid 'Cannot modify immutable object' error
1 parent 8c5eaf0 commit 6e1e853

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.releaserc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ export default {
4242
transform(commit) {
4343
const highlightTypes = ["feat", "fix", "perf"];
4444

45+
const modifiedCommit = { ...commit };
46+
4547
if (highlightTypes.includes(commit.type)) {
46-
commit.category = "🎯 Highlights";
48+
modifiedCommit.category = "🎯 Highlights";
4749
} else {
48-
commit.category = "🔧 Maintenance";
50+
modifiedCommit.category = "🔧 Maintenance";
4951
}
5052

51-
return commit;
53+
return modifiedCommit;
5254
},
5355
groupBy: "category",
5456
commitGroupsSort(a, b) {

0 commit comments

Comments
 (0)