Skip to content

Commit ccbc165

Browse files
committed
fix compile issues
1 parent 60a85f1 commit ccbc165

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,11 +814,12 @@ TEST: addTests('isRepositoryActions', [
814814

815815
const isStars = (url: URL | HTMLAnchorElement | Location = location): boolean => {
816816
const patharr = getCleanPathname(url).split('/');
817-
const [stars, user, subpath, ...extra] = patharr;
818-
return stars === 'stars'
817+
const [stars, , subpath, ] = patharr; // only get the elements we're only to check from destructuring to avoid compile error
818+
return Boolean(stars === 'stars'
819819
&& ([1, 2, 4].includes(patharr.length)
820820
|| (subpath === 'lists' && patharr.length !== 3)
821-
|| (['repositories', 'topics'].includes(subpath) && patharr.length === 3));
821+
|| (subpath && ['repositories', 'topics'].includes(subpath) && patharr.length === 3))
822+
);
822823
};
823824

824825
TEST: addTests('isStars', [

0 commit comments

Comments
 (0)