Toolbox-XToolbox-X
GuardsChecker Functions

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

playground.ts

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

playground.ts

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

playground.ts

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

playground.ts

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

playground.ts

Dependencies

  • Uses reverseString internally 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

playground.ts

Notes

  • This uses the Unicode \p{Emoji} property from RegExp Unicode property escapes.
  • The u flag is required for proper Unicode handling.

Last updated: Tue, Jun 09, 2026 04:51:46AM (UTC)

On this page