Update js/main.js

commit review suggestion

Co-authored-by: Samar Dhwoj Acharya <coolsamar207@gmail.com>
This commit is contained in:
anzz1 2022-10-21 19:31:06 +03:00 committed by GitHub
parent 65f0aba0c6
commit 8e88796c63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,10 +112,10 @@ function fetchAndShow(repo) {
repo = repo.replace('https://github.com/', ''); repo = repo.replace('https://github.com/', '');
repo = repo.replace('http://github.com/', ''); repo = repo.replace('http://github.com/', '');
repo = repo.replace(/\.git$/, ''); repo = repo.replace(/\.git$/, '');
repo = repo.replace(/^\s+/,''); // remove leading whitespace repo = repo.replace(/^\s+/, ''); // remove leading whitespace
repo = repo.replace(/\s+$/,''); // remove trailing whitespace repo = repo.replace(/\s+$/, ''); // remove trailing whitespace
repo = repo.replace(/^\/+/,''); // remove leading slashes repo = repo.replace(/^\/+/, ''); // remove leading slashes
repo = repo.replace(/\/+$/,''); // remove trailing slashes repo = repo.replace(/\/+$/, ''); // remove trailing slashes
fetch( fetch(
`https://api.github.com/repos/${repo}/forks?sort=stargazers&per_page=100` `https://api.github.com/repos/${repo}/forks?sort=stargazers&per_page=100`