mirror of
https://github.com/techgaun/active-forks.git
synced 2025-01-03 11:22:17 +01:00
remove leading/trailing whitespace&slashes
This commit is contained in:
parent
c87b9bf9e9
commit
53ac693d5a
1 changed files with 4 additions and 0 deletions
|
@ -112,6 +112,10 @@ function fetchAndShow(repo) {
|
|||
repo = repo.replace('https://github.com/', '');
|
||||
repo = repo.replace('http://github.com/', '');
|
||||
repo = repo.replace(/\.git$/, '');
|
||||
repo = repo.replace(/^\s+/,''); // remove leading whitespace
|
||||
repo = repo.replace(/\s+$/,''); // remove trailing whitespace
|
||||
repo = repo.replace(/^\/+/,''); // remove leading slashes
|
||||
repo = repo.replace(/\/+$/,''); // remove trailing slashes
|
||||
|
||||
fetch(
|
||||
`https://api.github.com/repos/${repo}/forks?sort=stargazers&per_page=100`
|
||||
|
|
Loading…
Reference in a new issue