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:
parent
d2336d1e85
commit
7866ad8d5d
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user