check-my-palindrome
v1.0.0
Published
This package checks whether a certain string is a palindrome or not
Maintainers
Readme
🔁 check-my-palindrome
A simple and lightweight utility to check if a word or phrase is a palindrome — with optional case sensitivity.
📦 Install
npm install check-my-palindrome🚀 Usage
import checkPalindrome from 'check-my-palindrome';
checkPalindrome(word, isSensitive);🧠 Function Details
checkPalindrome(word, isSensitive)
Parameters word { type: string, required: yes, description: The word or phrase to check for palindrome }
isSensitive { type: boolean, required: no, description: Case sensitivity flag. Set to true to make the check case-sensitive. Defaults to false }
✅ Returns:
trueif the input is a palindromefalseotherwise
🧪 Examples
checkPalindrome("Racecar"); // true as isSensitive is false by defaults
checkPalindrome("Racecar", true); // false
checkPalindrome("Racecar", false); // true as it is not case sensitive anymore
checkPalindrome("madam", true); // true
checkPalindrome("Was it a car or a cat I saw?"); // true
checkPalindrome("No lemon, no melon!"); // true📄 License
MIT
