mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Links check: fix for prefix check (#10786)
Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
parent
22ac0dd69d
commit
6a5dfc94b5
|
@ -37,7 +37,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "facebook",
|
"name": "facebook",
|
||||||
"url": "https://www.facebook.com/parsiqnet/"
|
"url": "https://facebook.com/parsiqnet/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "medium",
|
"name": "medium",
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "facebook",
|
"name": "facebook",
|
||||||
"url": "https://www.facebook.com/parsiqnet/"
|
"url": "https://facebook.com/parsiqnet/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "medium",
|
"name": "medium",
|
||||||
|
|
|
@ -28,7 +28,7 @@ const linksKeys = {
|
||||||
"telegram_news": "https://t.me/", // read-only announcement channel
|
"telegram_news": "https://t.me/", // read-only announcement channel
|
||||||
"medium": "", // url contains 'medium.com'
|
"medium": "", // url contains 'medium.com'
|
||||||
"discord": "https://discord.com/",
|
"discord": "https://discord.com/",
|
||||||
"reddit": "https://redditX.com/",
|
"reddit": "https://reddit.com/",
|
||||||
"facebook": "https://facebook.com/",
|
"facebook": "https://facebook.com/",
|
||||||
"youtube": "https://youtube.com/",
|
"youtube": "https://youtube.com/",
|
||||||
"coinmarketcap": "https://coinmarketcap.com/",
|
"coinmarketcap": "https://coinmarketcap.com/",
|
||||||
|
@ -159,7 +159,7 @@ function isInfoLinksValid(links: unknown, path: string, address: string, chain:
|
||||||
if (!Object.prototype.hasOwnProperty.call(linksKeys, fname)) {
|
if (!Object.prototype.hasOwnProperty.call(linksKeys, fname)) {
|
||||||
return [`Not supported field in links '${fname}'. Supported keys: ${linksKeysString}`, ""];
|
return [`Not supported field in links '${fname}'. Supported keys: ${linksKeysString}`, ""];
|
||||||
}
|
}
|
||||||
const prefix = linksKeys[f];
|
const prefix = linksKeys[fname];
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
if (!furl.startsWith(prefix)) {
|
if (!furl.startsWith(prefix)) {
|
||||||
return [`Links field '${fname}': '${furl}' must start with '${prefix}'. Supported keys: ${linksKeysString}`, ""];
|
return [`Links field '${fname}': '${furl}' must start with '${prefix}'. Supported keys: ${linksKeysString}`, ""];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user