@hiveposh/so-many-frontends
Advanced tools
Comparing version 0.0.17 to 0.0.18
18
index.js
@@ -115,2 +115,18 @@ const hiveDomains = [ | ||
module.exports = [isHiveUrl, parseHiveUrl, hiveDomains]; | ||
function appStringToHiveLink(app, author, permlink) { | ||
if (app.includes('leothreads')) { | ||
return `https://leofinance.io/threads/@${author}/${permlink}` | ||
} | ||
if (app.includes('dBuzz')) { | ||
return `https://d.buzz/#/@${author}/c/${permlink}` | ||
} | ||
if (app.includes('liketu')) { | ||
return `https://www.liketu.com/@${author}/${permlink}` | ||
} | ||
return `https://hivel.ink/@${author}/${permlink}` | ||
} | ||
module.exports = [isHiveUrl, parseHiveUrl, hiveDomains, appStringToHiveLink]; |
{ | ||
"name": "@hiveposh/so-many-frontends", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "JS module for listing Hive front ends", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const test = require("node:test"); | ||
const assert = require("node:assert"); | ||
const [isHiveUrl, parseHiveUrl, hiveDomains] = require("./index.js"); | ||
const [isHiveUrl, parseHiveUrl, hiveDomains, appStringToHiveLink] = require("./index.js"); | ||
@@ -213,1 +213,7 @@ test("hiveDomains is usable", (t) => { | ||
test("appStringToHiveLink liketu", (t) => { | ||
assert.deepEqual(appStringToHiveLink("liketu","dkid14","star-wars-shadow-battle"), | ||
'https://www.liketu.com/@dkid14/star-wars-shadow-battle' | ||
); | ||
}); |
11548
303