Code & Deploy
siGit Code
Git Hosting
Toggle menu
siGit Code
Git Hosting
Sign in
Sign in
@devries-cameron20
/
t3code-1
Fork
0
The best way to control Claude Code, Codex and more from any computer or phone
t3code-1
/
packages
/
shared
/
src
/
url.ts
Code
Commits
Issues
Pulls
Cloud Agent
CICD
main
main
ts
8 lines
248 Bytes
Copy permalink
Copy
Raw
1
// `URL.parse` and `URL.canParse` are missing before Safari 17/18, and client code ships unpolyfilled.
2
export
function
parseUrl
(
value
:
string
,
base
?:
string
):
URL
|
null
{
3
try
{
4
return
new
URL
(
value
,
base
);
5
}
catch
{
6
return
null
;
7
}
8
}