Stripe checkmark emojis from display names (close #396) (#419)

This commit is contained in:
Paul Frazee 2023-04-07 11:09:25 -05:00 committed by GitHub
parent 4b98992257
commit ab11f206d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 23 deletions

View file

@ -0,0 +1,12 @@
// \u2705 = ✅
// \u2713 = ✓
// \u2714 = ✔
// \u2611 = ☑
const CHECK_MARKS_RE = /[\u2705\u2713\u2714\u2611]/gu
export function sanitizeDisplayName(str: string): string {
if (typeof str === 'string') {
return str.replace(CHECK_MARKS_RE, '')
}
return ''
}