multiple: check when var is possibly undefined
In cases where a field on an object might be undefined, rather omit the value than set the field to undefined.
This commit is contained in:
parent
d4436dc6a9
commit
0d4bb26e0f
15 changed files with 82 additions and 60 deletions
|
|
@ -64,7 +64,7 @@ export const useCheckRepositoriesAvailability = () => {
|
|||
// Transform the fresh repos array into a Set to access its elements in O(1)
|
||||
// complexity later in the for loop.
|
||||
const freshReposUrls = new Set(
|
||||
freshRepos.data?.map((freshRepo) => freshRepo.url)
|
||||
freshRepos?.data?.map((freshRepo) => freshRepo.url)
|
||||
);
|
||||
for (const customRepo of customRepositories) {
|
||||
if (customRepo.baseurl && !freshReposUrls.has(customRepo.baseurl[0])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue