Skip to content

Latest commit

 

History

History
43 lines (22 loc) · 1.47 KB

README.md

File metadata and controls

43 lines (22 loc) · 1.47 KB

This entire repository was created completely with AI, using the hero-ai-package-creator, which is open-source, uses GPT-4, and is written & maintained by Sam Chahine ❣️🧞‍♀️

hero-emoji-utils

A package for working with emojis in strings, allowing users to manipulate strings containing any type of emojis.

Functions

emojiSplit

Splits a string into an array of characters and emojis. Will handle standard single-codepoint emojis, combined emojis (e.g. country flags), and skin-tone-modified emojis. It does not handle invalid emoji sequences or emojis with multiple skin tones.

Example usage:

emojiSplit('Hello 😃🌎🎉'); // -> ['H', 'e', 'l', 'l', 'o', ' ', '😃', '🌎', '🎉']

emojiCount

Counts the number of emojis in a string. Will handle standard single-codepoint emojis, combined emojis (e.g. country flags), and skin-tone-modified emojis. It does not handle invalid emoji sequences or emojis with multiple skin tones.

Example usage:

emojiCount('Hello 😃🌎🎉'); // -> 3

Sam Chahine at Hero

Tests for emojiCount

emojiCount

Tests for emojiSplit

emojiSplit