Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1263260
format-external-url.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
377 B
Referenced Files
None
Subscribers
None
format-external-url.ts
View Options
// this is not an ultra-safe parser. It's meant to help parse urls that users
// have entered in a simple input file withour validation
export
function
formatExternalURL
(
url
:
string
)
{
const
trimmed
=
url
.
trim
();
if
(
!
trimmed
.
toLowerCase
().
startsWith
(
"https://"
)
||
!
trimmed
.
toLowerCase
().
startsWith
(
"https://"
)
)
{
return
`http://
${
trimmed
}
`
;
}
return
trimmed
;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 16:50 (2 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
600225
Default Alt Text
format-external-url.ts (377 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment