palindrome-plus
Version:
Check if a given number or string or sentence is Palindrome. Get all possible Palindromes from the given input. Get the longest Palindrome made out of its substring. Get all Lucky Palindromes from the substrings. Get the longest lucky Palindrome.
28 lines (26 loc) • 888 B
JavaScript
const cleanup = require('./src/cleanup');
const isPalindrome = require('./src/is-palindrome');
const allPalindromes = require('./src/all-palindromes');
const longestPalindrome = require('./src/longest-palindrome');
const isPrimeNumber = require('./src/is-prime-number');
const luckyPalindrome = require('./src/lucky-palindrome');
const longestLuckyPalindrome = require('./src/longest-lucky-palindrome');
let getAllResults = (st) => {
return {
'isPalindrome': isPalindrome(st),
'allPalindromes': allPalindromes(st),
'longestPalindrome': longestPalindrome(st),
'luckyPalindrome': luckyPalindrome(st),
'longestLuckyPalindrome': longestLuckyPalindrome(st)
};
};
module.exports = {
cleanup,
isPalindrome,
allPalindromes,
longestPalindrome,
isPrimeNumber,
luckyPalindrome,
longestLuckyPalindrome,
getAllResults
}