Added emoji filter
All checks were successful
Build / Publish Docs (push) Successful in 42s
Build / Build NPM Project (push) Successful in 1m7s
Build / Tag Version (push) Successful in 9s

This commit is contained in:
2026-01-18 12:16:12 -05:00
parent ead8fcffc0
commit 1be2c1118f
2 changed files with 10 additions and 2 deletions

View File

@@ -135,7 +135,15 @@ export function pascalCase(str?: string): string {
.join('');
}
/**
* Remove all emojis from a string
* @param {string} str Input string with emojis
* @returns {string} Sanitized string without emojis
*/
function removeEmojis(str: string): string {
const emojiRegex = /(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud83c[\udde6-\uddff]|[\ud83d[\ude00-\ude4f]|[\ud83d[\ude80-\udeff]|[\ud83c[\udd00-\uddff]|[\ud83d[\ude50-\ude7f]|[\u2600-\u26ff]|[\u2700-\u27bf]|[\ud83e[\udd00-\uddff]|[\ud83c[\udf00-\uffff]|[\ud83d[\ude00-\udeff]|[\ud83c[\udde6-\uddff])/g;
return str.replace(emojiRegex, '');
}
/**
* Generate a random hexadecimal value