UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

13 lines (12 loc) 546 B
/** * Checks if a string is a palindrome, with options to ignore case and spaces. * * Example: isPalindrome("A man a plan a canal Panama") → true * * @author @dailker * @param {string} str - The input string. * @param {boolean} [ignoreCase=true] - Whether to ignore case. * @param {boolean} [ignoreSpaces=true] - Whether to ignore spaces. * @returns {boolean} True if the string is a palindrome, false otherwise. */ export declare function isPalindrome(str: string, ignoreCase?: boolean, ignoreSpaces?: boolean): boolean;