Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hero-page/hero-emoji-strings

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hero-page/hero-emoji-strings

A library to manage strings with emojis, making it easier to manipulate, count and sanitize strings that contain emojis

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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-strings

A library to manage strings with emojis, making it easier to manipulate, count and sanitize strings that contain emojis.

Functions

emojiCount

Counts the number of emojis in a given string. Handles Unicode and shortcodes emojis. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and long strings with emojis. Extreme cases: strings with special characters, strings with a mixture of letters, numbers, and emojis. Ignored cases: malformed shortcodes.

replaceEmoji

Replaces all occurrences of a specific emoji in a string with another string (could be another emoji). Test cases: strings with single emoji, multiple emojis, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: invalid input emoji.

splitByEmoji

Splits a string into an array of strings divided by emojis. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and strings with various delimiters. Extreme cases: strings with special characters and long strings with emojis. Ignored cases: malformed shortcodes.

emojiPositions

Returns an array of positions where emojis are found in a string. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and long strings with emojis. Extreme cases: strings with special characters and strings with a mixture of letters, numbers, and emojis. Ignored cases: malformed shortcodes.

removeEmoji

Removes all emojis from a given string. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and long strings with emojis. Extreme cases: strings with special characters and strings with a mixture of letters, numbers, and emojis. Ignored cases: malformed shortcodes.

emojify

Converts a string with shortcodes to a string with actual emojis. Test cases: strings with shortcodes, no shortcodes, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: malformed shortcodes.

shortcodeify

Converts a string with emojis to a string with shortcodes. Test cases: strings with emojis, no emojis, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: unrecognizable emoji shortcodes.

isValidEmoji

Checks if a given string is a valid emoji. Test cases: valid Unicode and shortcode emojis, invalid emojis, and mixed character types. Extreme cases: special characters. Ignored cases: malformed shortcodes.

getContainedEmojis

Returns an array of distinct emojis contained in a given string. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and long strings with emojis. Extreme cases: strings with special characters, strings with a mixture of letters, numbers, and emojis. Ignored cases: malformed shortcodes.

substringWithEmoji

Returns a substring of the given string while treating emojis as single characters. Test cases: strings with single emojis, multiple emojis, no emojis, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: invalid indices.

lengthWithEmoji

Returns the length of the given string treating emojis as single characters. Test cases: strings with single emojis, multiple emojis, no emojis, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: malformed shortcodes.

indexOfEmoji

Returns the index of the first occurrence of the emoji in the given string or -1 if not present. Test cases: strings with single emojis, multiple emojis, no emojis, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: invalid input emoji.

Author

Sam Chahine, at Hero

Tests for emojiCount

emojiCount

Tests for emojify

emojify

Tests for lengthWithEmoji

lengthWithEmoji

Tests for removeEmoji

removeEmoji

Tests for replaceEmoji

replaceEmoji

Tests for shortcodeify

shortcodeify

Tests for substringWithEmoji

substringWithEmoji

Tests for indexOfEmoji

indexOfEmoji

Tests for isValidEmoji

isValidEmoji

Tests for getContainedEmojis

getContainedEmojis

Keywords

FAQs

Package last updated on 12 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc