FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
uniswap-interface/src/utils/listSort.ts at main · codeaudit/uniswap-interface · GitHub
codeaudit
/
uniswap-interface
Public
forked from
Uniswap/interface
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
uniswap-interface
/
src
/
utils
/
listSort.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (12 loc) · 527 Bytes
Breadcrumbs
uniswap-interface
/
src
/
utils
/
listSort.ts
Copy path
File metadata and controls
14 lines (12 loc) · 527 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
{
DEFAULT_LIST_OF_LISTS
}
from
'./../constants/lists'
const
DEFAULT_LIST_PRIORITIES
=
DEFAULT_LIST_OF_LISTS
.
reduce
<
{
[
listUrl
:
string
]
:
number
}
>
(
(
memo
,
listUrl
,
index
)
=>
{
memo
[
listUrl
]
=
index
+
1
return
memo
}
,
{
}
)
// use ordering of default list of lists to assign priority
export
default
function
sortByListPriority
(
urlA
:
string
,
urlB
:
string
)
{
if
(
DEFAULT_LIST_PRIORITIES
[
urlA
]
&&
DEFAULT_LIST_PRIORITIES
[
urlB
]
)
{
return
DEFAULT_LIST_PRIORITIES
[
urlA
]
-
DEFAULT_LIST_PRIORITIES
[
urlB
]
}
return
0
}
Back
|
FazBrowse Home
|
New Git URL