Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function lookupEmojiCharacter(icon) {
const codePoint = twemoji.convert.toCodePoint(icon)
if (!names[codePoint]) {
return null
}
// Don't display ™ as an emoji.
if (codePoint === '2122') {
return null
}
return codePoint
}
function grabTheRightIcon(rawText: string) {
// if variant is present as \uFE0F
return twemoji.convert.toCodePoint(
rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText
)
}
function grabTheRightIcon(rawText: string) {
// if variant is present as \uFE0F
return twemoji.convert.toCodePoint(
rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText
)
}
function getEmojiURL (surrogate) {
if (['™', '©', '®'].indexOf(surrogate) > -1) {
return ''
}
try {
// we could link to discord's cdn, but there's a lot of these
// and i'd like to minimize the amount of data we need directly from them
return `https://twemoji.maxcdn.com/2/svg/${Twemoji.convert.toCodePoint(surrogate)}.svg`
} catch (error) {
return ''
}
}
function getEmojiURL(surrogate) {
if (['™', '©', '®'].indexOf(surrogate) > -1) {
return '';
}
try {
// we could link to discord's cdn, but there's a lot of these
// and i'd like to minimize the amount of data we need directly from them
return `https://twemoji.maxcdn.com/2/svg/${Twemoji.convert.toCodePoint(surrogate)}.svg`;
} catch (error) {
return '';
}
}
function grabTheRightIcon(rawText: string): string {
// if variant is present as \uFE0F
return twemoji.convert.toCodePoint(
rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText
)
}
getEmojiImgFromCodepoint(codepoint) {
return this.parse(Twemoji.convert.fromCodePoint(codepoint));
}
};
let chr = x.map(y => twemoji.convert.fromCodePoint(y)).join('');
return twemoji.parse(chr);
'twemoji-url': function(emoji) {
const codePoint = twemoji.convert.toCodePoint(emoji.getValue());
return sassTypes.String(`url(${twemoji.base}svg/${codePoint}.svg)`);
}
}