Skip to content

Commit

Permalink
fix: remove brackets from author
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi-best committed Dec 5, 2024
1 parent 53a0c28 commit 24258a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions utils/scrape/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ const fetchDataFromGithub = async (
return repositories;
};

function cleanAuthor(link: string) {
return link.replace(/[\(\)]/g, '');
}

function convertToJSON(repositories: string[]): ScrapedRepository[] {
return repositories.map((repository) => {
const parser = new DOMParser();
Expand All @@ -92,8 +96,8 @@ function convertToJSON(repositories: string[]): ScrapedRepository[] {
return {
name,
link,
author,
authorLink,
author: cleanAuthor(author),
authorLink: cleanAuthor(authorLink),
};
});
}
Expand Down

0 comments on commit 24258a6

Please sign in to comment.