Skip to content

Commit a1ec910

Browse files
authored
FIX: URL needs explicit instantiation (#9)
1 parent f8d827b commit a1ec910

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

javascripts/discourse/lib/isValidUrl.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
export default function isValidUrl(string) {
22
try {
3-
URL(string);
3+
const url = new URL(string);
4+
5+
if (url) {
6+
return true;
7+
}
48
} catch (_) {
59
return false;
610
}

0 commit comments

Comments
 (0)