FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
uniswap_interface_sc/apps/web/src/utils/urlChecks.ts at main · stringcode86/uniswap_interface_sc · GitHub
stringcode86
uniswap_interface_sc
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
uniswap_interface_sc
/
apps
/
web
/
src
/
utils
/
urlChecks.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (12 loc) · 390 Bytes
Breadcrumbs
uniswap_interface_sc
/
apps
/
web
/
src
/
utils
/
urlChecks.ts
Copy path
File metadata and controls
13 lines (12 loc) · 390 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
export
function
hasURL
(
str
?:
string
)
:
boolean
{
if
(
!
str
)
{
return
false
}
const
pattern
=
new
RegExp
(
'([a-zA-Z0-9]+://)?'
+
// optional protocol
'([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?'
+
// optional username:password
'([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})'
+
// host name and subdomain
'(:[0-9]+)?(/.*)?'
,
// optional port and path
)
return
pattern
.
test
(
str
)
}
Back
|
FazBrowse Home
|
New Git URL