Skip to content

Commit

Permalink
chore: renamed value to comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen authored and gentlementlegen committed Mar 24, 2024
1 parent c87850c commit c2f40c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/parser/data-purge-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ export class DataPurgeModule implements Module {
}

transform(data: Readonly<GetActivity>, result: Result) {
for (const value of data.allComments) {
if (value.body && value.user?.login && result[value.user.login]) {
const newContent = value.body
for (const comment of data.allComments) {
if (comment.body && comment.user?.login && result[comment.user.login]) {
const newContent = comment.body
.replace(/^>.*$/gm, "")
.replace(/[\r\n]+/g, " ")
.replace(/\[.*?\]\(.*?\)/g, "")
.replace(/^\/\S+/g, "")
.trim();
if (newContent.length) {
result[value.user.login].comments = [
...(result[value.user.login].comments ?? []),
result[comment.user.login].comments = [
...(result[comment.user.login].comments ?? []),
{
content: newContent,
url: value.html_url,
type: value.type,
url: comment.html_url,
type: comment.type,
},
];
}
Expand Down

0 comments on commit c2f40c9

Please sign in to comment.