String Checkers
Predicate functions to check/compare strings.
Predicate functions to check/compare strings. These functions return true or false.
isCamelCase
Checks if a string follows the camelCase format.
Function Signature
isCamelCase(str: string): boolean;Parameters
str: The string to check.
Returns
Returns true if the string is in camelCase, otherwise false.
Example
isPascalCase
Checks if a string follows the PascalCase format.
Function Signature
isPascalCase(str: string): boolean;Parameters
str: The string to check.
Returns
Returns true if the string is in PascalCase, otherwise false.
Example
isSnakeCase
Checks if a string follows the snake_case format.
Function Signature
isSnakeCase(str: string): boolean;Parameters
str: The string to check.
Returns
Returns true if the string is in snake_case, otherwise false.
Example
isKebabCase
Checks if a string follows the kebab-case format.
Function Signature
isKebabCase(str: string): boolean;Parameters
str: The string to check.
Returns
Returns true if the string is in kebab-case, otherwise false.
Example
isPalindrome
Checks if a string is a palindrome (reads the same backward as forward, ignoring case and non-alphanumeric characters).
Function Signature
isPalindrome: (input: string): boolean;Parameters
input: The string to check.
Returns
Returns true if the string is a palindrome, otherwise false.
Example
Dependencies
- Uses
reverseStringinternally to perform the reversal comparison.
isEmojiOnly
Checks if a string contains only emojis.
Function Signature
isEmojiOnly(str: string): boolean;Parameters
str: The input string to check.
Returns
Returns true if the string contains only emojis, otherwise false.
Example
Notes
- This uses the Unicode
\p{Emoji}property from RegExp Unicode property escapes. - The
uflag is required for proper Unicode handling.
Last updated: Tue, Jun 09, 2026 04:51:46AM (UTC)
