Profile redesign: Fields iteration (#37682)
This commit is contained in:
13 files changed
+449
-383
No files matched your search
@@ -0,0 +1,11 @@
|
||||
export function isValidUrl(
|
||||
url: string,
|
||||
allowedProtocols = ['https:'],
|
||||
): boolean {
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
return allowedProtocols.includes(parsedUrl.protocol);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user