mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 17:03:26 +00:00
unit tests for provider checks, provider listings, utils and provider meta
This commit is contained in:
@@ -10,8 +10,8 @@ export function reorderOnIdList<T extends { rank: number; id: string }[]>(order:
|
||||
// only one in order list
|
||||
// negative means order [a,b]
|
||||
// positive means order [b,a]
|
||||
if (aIndex < 0) return 1; // A isnt in list, so A goes later on the list
|
||||
if (bIndex < 0) return -1; // B isnt in list, so B goes later on the list
|
||||
if (bIndex >= 0) return 1; // A isnt in list but B is, so A goes later on the list
|
||||
if (aIndex >= 0) return -1; // B isnt in list but A is, so B goes later on the list
|
||||
|
||||
// both not in list, sort on rank
|
||||
return b.rank - a.rank;
|
||||
|
Reference in New Issue
Block a user