@hiveposh/so-many-frontends
Advanced tools
Comparing version
12
index.js
@@ -33,2 +33,3 @@ const hiveDomains = [ | ||
"leofinance.io", | ||
"inleo.io", | ||
"3speak.tv", | ||
@@ -79,2 +80,11 @@ "reverio.io", | ||
} | ||
if (hiveLink.includes("inleo.io/posts/")) { | ||
hiveLink = hiveLink.replace("inleo.io/posts/", "inleo.io/@"); | ||
} | ||
if (hiveLink.includes("inleo.io/threads/")) { | ||
hiveLink = hiveLink.replace( | ||
"inleo.io/threads/", | ||
"inleo.io/@" | ||
); | ||
} | ||
if (hiveLink.includes("3speak.tv")) { | ||
@@ -136,3 +146,3 @@ hiveLink = hiveLink.replace("3speak.tv/watch?v=", "3speak.tv/@"); | ||
if (app.includes("leothreads")) { | ||
return `https://leofinance.io/threads/${author}/${permlink}`; | ||
return `https://inleo.io/threads/${author}/${permlink}`; | ||
} | ||
@@ -139,0 +149,0 @@ |
{ | ||
"name": "@hiveposh/so-many-frontends", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "JS module for listing Hive front ends", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
49
tests.js
@@ -18,2 +18,16 @@ const test = require("node:test"); | ||
test("isHiveUrl leo path", (t) => { | ||
assert.strictEqual( | ||
isHiveUrl("https://leofinance.io/posts/taskmaster4450/the-hive-protocol-the-largest-financial-institution-in-the-world"), | ||
true | ||
); | ||
}); | ||
test("isHiveUrl inleo path", (t) => { | ||
assert.strictEqual( | ||
isHiveUrl("https://inleo.io/posts/taskmaster4450/the-hive-protocol-the-largest-financial-institution-in-the-world"), | ||
true | ||
); | ||
}); | ||
test("isHiveUrl happy path 2", (t) => { | ||
@@ -34,2 +48,6 @@ assert.strictEqual( | ||
test("isHiveUrl inleo dev path", (t) => { | ||
assert.strictEqual(isHiveUrl("https://dev.inleo.io/threads"), true); | ||
}); | ||
test("isHiveUrl negative path", (t) => { | ||
@@ -215,2 +233,3 @@ assert.strictEqual( | ||
test("leofinance new UI post view URL", (t) => { | ||
@@ -224,2 +243,28 @@ assert.deepEqual(parseHiveUrl("https://leofinance.io/posts/bitcoinflood/godfather-of-ai-warning-and-uk-crypto"), { | ||
test("inleo new UI blog view URL", (t) => { | ||
assert.deepEqual(parseHiveUrl("https://inleo.io/posts/idiosyncratic1/proof-of-share-posh-leothreads"), { | ||
domain: "inleo.io", | ||
author: "idiosyncratic1", | ||
permlink: "proof-of-share-posh-leothreads" | ||
}); | ||
}); | ||
test("inleo new UI threads view URL", (t) => { | ||
assert.deepEqual(parseHiveUrl("https://inleo.io/threads/theycallmedan/re-leothreads-7tyyx8co"), { | ||
domain: "inleo.io", | ||
author: "theycallmedan", | ||
permlink: "re-leothreads-7tyyx8co" | ||
}); | ||
}); | ||
test("inleo new UI post view URL", (t) => { | ||
assert.deepEqual(parseHiveUrl("https://inleo.io/posts/bitcoinflood/godfather-of-ai-warning-and-uk-crypto"), { | ||
domain: "inleo.io", | ||
author: "bitcoinflood", | ||
permlink: "godfather-of-ai-warning-and-uk-crypto" | ||
}); | ||
}); | ||
test("appStringToHiveLink liketu", (t) => { | ||
@@ -231,7 +276,7 @@ assert.deepEqual(appStringToHiveLink("liketu","dkid14","star-wars-shadow-battle"), | ||
test("appStringToHiveLink liketu", (t) => { | ||
test("appStringToHiveLink leofinance", (t) => { | ||
assert.deepEqual(appStringToHiveLink("leothreads","bitcoinflood","godfather-of-ai-warning-and-uk-crypto"), | ||
'https://leofinance.io/threads/bitcoinflood/godfather-of-ai-warning-and-uk-crypto' | ||
'https://inleo.io/threads/bitcoinflood/godfather-of-ai-warning-and-uk-crypto' | ||
); | ||
}); |
13886
12.77%387
13.49%