chore: Check for empty strings in name formatter (#5434)
This commit is contained in:
parent
cb4dd7e633
commit
e585b227f1
1 changed files with 10 additions and 7 deletions
|
@ -34,6 +34,7 @@ export const hasEmojiSupport = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const removeEmoji = text => {
|
export const removeEmoji = text => {
|
||||||
|
if (text) {
|
||||||
return text
|
return text
|
||||||
.replace(
|
.replace(
|
||||||
/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,
|
/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,
|
||||||
|
@ -41,4 +42,6 @@ export const removeEmoji = text => {
|
||||||
)
|
)
|
||||||
.replace(/\s+/g, ' ')
|
.replace(/\s+/g, ' ')
|
||||||
.trim();
|
.trim();
|
||||||
|
}
|
||||||
|
return '';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue