Skip to content

Commit 623af67

Browse files
authored
Use trim and split util (#4339)
1 parent 182269f commit 623af67

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

extension/src/experiments/model/collect.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ const collectCommitData = (
112112
acc: { [sha: string]: CommitData },
113113
commit: string
114114
) => {
115-
const [sha, author, date, refNamesWithKey] = commit
116-
.split('\n')
117-
.filter(Boolean)
115+
const [sha, author, date, refNamesWithKey] = trimAndSplit(commit)
118116

119117
if (!sha) {
120118
return
@@ -150,7 +148,7 @@ const formatCommitMessage = (commit: string | undefined) => {
150148
if (!commit) {
151149
return undefined
152150
}
153-
const lines = commit.split('\n').filter(Boolean)
151+
const lines = trimAndSplit(commit)
154152
return `${lines[0]}${lines.length > 1 ? ' ...' : ''}`
155153
}
156154

0 commit comments

Comments
 (0)