t3dotgg / chirp

https://xn--uo8h.t3.gg/
393 stars 61 forks source link

🐛 temporarily fixed the issue of emojies accepting number as input #4

Closed prabincankod closed 1 year ago

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to a Personal Account owned by @t3dotgg on Vercel.

@t3dotgg first needs to authorize it.

t3dotgg commented 1 year ago

Numbers are used in strings often for emojis, are you sure this works on all emojis?

tunnckoCore commented 1 year ago

@t3dotgg we can use emoji-regex for this and just ensure we always getting just the emojis. It's by a well known Open Sourcerer.

Just let it as it was originally, then just filter the content with something similar.

import emojiRegex from 'emoji-regex';

const str = "pizza 🍕 temp 🐛 foo";
const result = str.match(emojiRegex());

console.log(result.join(""));
// => 🍕🐛