Skip to content

Commit ceba2e5

Browse files
committed
more linting, hopefully OK this time
1 parent 7734cea commit ceba2e5

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

index.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -813,30 +813,31 @@ TEST: addTests('isRepositoryActions', [
813813
]);
814814

815815
const isStars = (url: URL | HTMLAnchorElement | Location = location): boolean => {
816-
const patharr = getCleanPathname(url).split('/'), [stars, user, subpath, ...extra] = patharr;
817-
return stars === 'stars'
818-
&& ([1, 2, 4].includes(patharr.length)
819-
|| (subpath === 'lists' && patharr.length !== 3)
820-
|| (['repositories', 'topics'].includes(subpath) && patharr.length == 3));
821-
}
816+
const patharr = getCleanPathname(url).split('/');
817+
const [stars, user, subpath, ...extra] = patharr;
818+
return stars === 'stars'
819+
&& ([1, 2, 4].includes(patharr.length)
820+
|| (subpath === 'lists' && patharr.length !== 3)
821+
|| (['repositories', 'topics'].includes(subpath) && patharr.length === 3));
822+
};
822823
TEST: addTests('isStars', [
823824
'https://github.com/stars',
824825
'https://github.com/stars/lstn',
825826
'https://github.com/stars/lstn/repositories',
826827
'https://github.com/stars/lstn/topics',
827-
'https://github.com/stars/lstn/lists/test'
828+
'https://github.com/stars/lstn/lists/test',
828829
]);
829830

830831
export const isOwnStars = (url: URL | HTMLAnchorElement | Location = location): boolean =>
831-
isStars(url)
832-
&& [['stars'],['stars', getLoggedInUser()]].some(
833-
(needle => arr => arr.length === needle.length
834-
&& arr.every((v, i) => v === needle[i]))(getCleanPathname(url).split('/').slice(0,2))
835-
);
832+
isStars(url)
833+
&& [['stars'],['stars', getLoggedInUser()]].some(
834+
(needle => arr => arr.length === needle.length
835+
&& arr.every((v, i) => v === needle[i]))(getCleanPathname(url).split('/').slice(0,2))
836+
);
836837

837838
export const isStarsList = (url: URL | HTMLAnchorElement | Location = location): boolean => isStars(url) && getCleanPathname(url).split('/')[2] === 'lists';
838839
TEST: addTests('isStarsList', [
839-
'https://github.com/stars/lstn/lists/test'
840+
'https://github.com/stars/lstn/lists/test',
840841
]);
841842

842843
export const isOwnStarsList = (url: URL | HTMLAnchorElement | Location = location): boolean => isOwnStars(url) && getCleanPathname(url).split('/')[2] === 'lists';

0 commit comments

Comments
 (0)