Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function updateForks(forks: string[]): Promise {
// Don't validate current page: it exists; it won't be shown in the list; it will be added later anyway
const validForks = await pFilter(forks.filter(fork => fork !== getRepoURL()), validateFork);
// Add current repo to cache if it's a fork
if (isRepoWithAccess() && findForkedRepo()) {
save([...validForks, getRepoURL()].sort(undefined));
} else {
save(validForks);
}
}