@hiveposh/so-many-frontends
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -26,3 +26,10 @@ const hiveDomains = [ | ||
for (const i in hiveDomains) { | ||
const parsedUrl = new URL(url); | ||
let parsedUrl | ||
try { | ||
parsedUrl = new URL(url); | ||
} catch(err) { | ||
return false; | ||
} | ||
if ( | ||
@@ -29,0 +36,0 @@ parsedUrl.host == hiveDomains[i] || |
{ | ||
"name": "@hiveposh/so-many-frontends", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "JS module for listing Hive front ends", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
10
tests.js
@@ -28,2 +28,12 @@ const test = require("node:test"); | ||
test("isHiveUrl invalid URL", (t) => { | ||
assert.strictEqual( | ||
isHiveUrl( | ||
"/r/the-mystery-of-time-challengers-1991.html" | ||
), | ||
false | ||
); | ||
}); | ||
test("parseHiveUrl reverio question", (t) => { | ||
@@ -30,0 +40,0 @@ assert.deepEqual( |
7489
181