Cannot add a new profile
revivalme opened this issue · 1 comments
revivalme commented
I'm trying to add a new discord profile, but get an error
Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value).findIndex is not a function
const { SocialLinks, TYPE_DESKTOP } = require("social-links");
const socialLinks = new SocialLinks();
const discordProfile = {
name: "discord",
matches: [
{
match: "(https?://)?(www.)?discord.gg/({GENERATED})",
group: 3,
pattern: "https://discord.gg/{GENERATED}",
type: TYPE_DESKTOP
},
{ match: "({GENERATED})", group: 1 }
]
};
socialLinks.addProfile("discord", discordProfile);
const res = socialLinks.isValid("discord", "https://discord.gg/mTpXg2mr");
console.log(res);
gkucmierz commented
const discordProfileMatches = [
{
match: "(https?://)?(www.)?discord.gg/({PROFILE_ID})",
group: 3,
pattern: "https://discord.gg/{PROFILE_ID}",
type: TYPE_DESKTOP
},
{ match: "({PROFILE_ID})", group: 1 }
];
socialLinks.addProfile("discord", discordProfileMatches);
Try to add matches
array only.
https://codesandbox.io/s/nostalgic-night-4mq1g
It needs to be clarified in README.