1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove Boolean(url)

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen 2021-07-06 16:25:31 +03:00
parent d2336d1e85
commit 7866ad8d5d
No known key found for this signature in database
GPG Key ID: 54B44603D251B788

View File

@ -27,14 +27,12 @@
* @return {boolean}
*/
export const isValidURL = (url: string | undefined | null) => {
if (Boolean(url)) {
try {
new URL(url);
try {
new URL(url);
return true;
} catch {
// ignore TypeError and return false
}
return true;
} catch {
// ignore TypeError and return false
}
return false;