diff --git a/.gitignore b/.gitignore index 69f6b69d..b377c352 100755 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ dist sw.* .env .output +content/2.functions/ diff --git a/content/2.functions/actions.md b/content/2.functions/actions.md deleted file mode 100644 index d67bba1d..00000000 --- a/content/2.functions/actions.md +++ /dev/null @@ -1,88 +0,0 @@ -# Actions - -A collection of useful actions - -Scrolls to the element with the specified ID. - -```js [js] -scrollToAnchor('#my-anchor') -``` - -Smoothly scroll to the top of the page - -```js [js] -scrollToTop() -``` - -Smoothly scroll to the bottom of the page - -```js [js] -scrollToBottom() -``` - -Toggles the body scroll with the specified class name - -```js [js] -toggleBodyScroll('overflow-hidden') -``` - -Toggles the element scroll - -```js [js] -toggleElementScroll(document.querySelector('#my-element')) -``` - -Copies a text to the clipboard - -```js [js] -copyToClipboard() -``` - -Toggles the fullscreen mode - -```js [js] -toggleFullScreen() -``` - -Toggles the dark mode - -```js [js] -toggleDarkMode() -``` - -Redirects to a new URL - -```js [js] -redirect('https://example.com') -``` - -Resets a form - -```js [js] -resetForm(document.querySelector('form')) -``` - -Focuses on an element - -```js [js] -focusOn(document.querySelector('#my-element')) -``` - -Focuses on the first element - -```js [js] -focusOnFirst(document.querySelector('#my-element')) -``` - -Focuses on the last element - -```js [js] -focusOnLast(document.querySelector('#my-element')) -``` - -Sets up a keyboard trap within an HTML element, allowing the focus to cycle between the first and last focusable elements when the Tab key is pressed. - -```js [js] -focusTrap(document.querySelector('#my-element')) -``` - diff --git a/content/2.functions/detections.md b/content/2.functions/detections.md deleted file mode 100644 index 0a67d783..00000000 --- a/content/2.functions/detections.md +++ /dev/null @@ -1,300 +0,0 @@ -# Detections - -A collection of detections for common data types - -### detectDevice - -Detect the current device type (Mobile or Desktop) - -```js [js] -detectDevice() -``` - -**Returns:** `Mobile` or `Desktop` - -### detectOS - -Detect the current operating system - -```js [js] -detectOS() -``` - -**Returns:** `Windows`, `Mac`, `Linux`, `UNIX`, or `Unknown` - -### detectBrowser - -Detects the user's browser based on the user agent string. - -```js [js] -detectBrowser() -``` - -**Returns:** `Chrome`, `Firefox`, `Safari`, `Opera`, `Edge`, `IE`, or `Unknown` - -### detectActiveBrowser - -Detect if the browser window is currently active or hidden. - -```js [js] -detectActiveBrowser() -``` - -### detectColorScheme - -Detect the current color scheme (Light or Dark) - -```js [js] -detectColorScheme() -``` - -**Returns:** `Light` or `Dark` - -### detectBrowserLanguage - -Detect the current browser language - -```js [js] -detectBrowserLanguage() -``` - -### detectGeolocation - -Detect the current user's location - -```js [js] -detectUserLocation() -``` - -**Returns:** `US`, `UK`, `CA`, `AU`, `NZ`, `EU`, `Unknown` - -### detectUserTimezone - -Detect the current user's Timezone - -```js [js] -detectUserTimezone() -``` - -### detectDeviceOrientation - -Detect the currect device orientation - -```js [js] -detectDeviceOrientation() -``` - -### detectDeviceMotion - -Detect the current device motion - -```js [js] -detectDeviceMotion() -``` - -Detect the browser's window size - -```js [js] -detectWindowSize() -``` - -Detect the screen or monitor size - -```js [js] -detectScreenSize() -``` - -Detect the container size via ID - -```js [js] -detectContainerSize('container') -``` - -### detectTailwindBreakpoint - -Detect the current breakpoint based on Tailwind CSS breakpoints - -```js [js] -detectTailwindBreakpoint() -``` - -### detectTailwindContainerBreakpoint - -Detect the current container breakpoint based on Tailwind CSS breakpoints - -```js [js] -detectTailwindContainerBreakpoint('container') -``` - -Detect the current scroll position of the window - -```js [js] -detectScrollPosition() -``` - -Detect the current mouse position within the window - -```js [js] -detectMousePosition(event) -``` - -Detect the current mouse position within a container via ID - -```js [js] -detectRelativeMousePosition('container', event) -``` - -### detectNetworkStatus - -Detect the current network status of the user (Online or Offline) - -```js [js] -detectNetworkStatus() -``` - -Detect the current memory status of the user (RAM) - -```js [js] -detectMemoryStatus() -``` - -### detectPerformance - -Detect the current performance status of the user (CPU, RAM, etc.) - -```js [js] -detectPerformance() -``` - -// Detect the current storage status of the user (Local Storage, Session Storage) - -```js [js] -detectStorage() -``` - -Returns a cookie value by name - -```js [js] -detectCookie('name') -``` - -### detectLocalStorage - -Returns a local storage value by name and parses it into JSON - -```js [js] -detectLocalStorage('name') -``` - -Returns a session storage value by name and parses it into JSON - -```js [js] -detectSessionStorage('name') -``` - -Returns a value from the URL by name - -```js [js] -detectURLParameters('http://url.com/page?name=Adam&surname=Smith') -``` - -Returns a value from the URL hash by name - -```js [js] -detectURLHashParameters() -``` - -Retrieves and returns the parameters from the URL search query string - -```js [js] -detectURLSearchParameters() -``` - -### detectURL - -Returns the current URL - -```js [js] -detectURL() -``` - -### detectDomain - -Returns the current domain - -```js [js] -detectDomain() -``` - -### detectIP - -Returns the current IP address - -```js [js] -detectIP() -``` - -### detectPort - -Returns the current port - -```js [js] -detectPort() -``` - -Returns the current protocol (HTTP or HTTPS) - -```js [js] -detectProtocol() -``` - -Returns the URL of the referring page (the page that linked to the current page) - -```js [js] -detectReferrer() -``` - -### detectCachedData - -Retrieves cached entries and optionally filters the entries based on a provided key - -```js [js] -detectCachedData('abc') -``` - -Detects if the element is currently in the viewport - -```js [js] -detectInViewport(element) -``` - -Detects if the element is currently in the container via ID - -```js [js] -detectInContainer(element, 'container') -``` - -Detects if the element is overflowing vertically - -```js [js] -detectOverflowingY(element) -``` - -Detects if the element is overflowing horizontally - -```js [js] -detectOverflowingX(element) -``` - -Detects if the element is scrollable (overflowing vertically or horizontally) - -```js [js] -detectScrollable(element) -``` - -Detects if the elements is an HTML element - -```js [js] -detectElement() -``` - diff --git a/content/2.functions/formatters.md b/content/2.functions/formatters.md deleted file mode 100644 index 2831dfc7..00000000 --- a/content/2.functions/formatters.md +++ /dev/null @@ -1,64 +0,0 @@ -# Formatters - -A collection of formatters for common data types - -### formatCurrency - -Format numbers into local currency - -```js [js] -formatCurrency(1234.56) -``` - -**Returns:** $1,234.56 - -### formatValuation - -Format numbers into valuations displayed in thounsands, millions or billions - -```js [js] -formatValuation(1234567890) -``` - -**Returns:** $1.23B - -### formatTime - -Format time into hours, minutes, and seconds - -```js [js] -formatTime(3723) -``` - -**Returns:** 1hr 2min 3s - -### formatDatetime - -Format Unix timestamp into a datetime string - -```js [js] -formatDatetime(1619097600) -``` - -**Returns:** 2021-04-22 00:00:00 - -### formatPercentage - -Format a number into a percentage - -```js [js] -formatPercentage(0.1234) -``` - -**Returns:** 12.34% - -### formatList - -Create a string of comma-separated values from an array of strings with an optional conjunction. - -```js [js] -commaList(['one', 'two', 'three']) -``` - -**Returns:** one, two and three - diff --git a/content/2.functions/generators.md b/content/2.functions/generators.md deleted file mode 100644 index 1c3bc453..00000000 --- a/content/2.functions/generators.md +++ /dev/null @@ -1,24 +0,0 @@ -# Generators - -A collection of generators - -### generateShortId - -Generate a unique short ID based on the current timestamp - -```js [js] -generateShortId(36) -``` - -**Returns:** 1HR2MIN3S - -### generateInitials - -Generate initials from any string - -```js [js] -generateInitials('John Doe') -``` - -**Returns:** JD - diff --git a/content/2.functions/modifiers.md b/content/2.functions/modifiers.md deleted file mode 100644 index 5fccd602..00000000 --- a/content/2.functions/modifiers.md +++ /dev/null @@ -1,514 +0,0 @@ -# Modifiers - -Modifiers are a key feature of Mods that allow you to easily modify and enhance your content. They are small pieces of code that can be applied to your JS to add functionality, validation or style. - -### widont - -Adds a space between the last two words in a string. - -```js [js] -widont('Cool cool cool') -``` - -**Returns:** cool cool cool - -### stripHtml - -Strip HTML tags from a string. - -```js [js] -stripHtml('

Hello World

') -``` - -**Returns:** Hello World - -### escapeHtml - -Escape HTML entities in a string. - -```js [js] -escapeHtml('

Hello World

') -``` - -**Returns:** <p>Hello World</p> - -### unescapeHtml - -Unescape HTML entities in a string. - -```js [js] -unescapeHtml('<p>Hello World</p>') -``` - -**Returns:**

Hello World

- -### stripTags - -Strip HTML tags from a string. - -```js [js] -stripTags('

Hello World

') -``` - -**Returns:** Hello World - -### slugify - -Converts a string to-a-slug. - -```js [js] -slugify('Hello World') -``` - -**Returns:** hello-world - -### deslugify - -Converts a slug to a string. - -```js [js] -deslugify('hello-world') -``` - -**Returns:** hello world - -### truncate - -Truncates a string to a specified length of characters. - -```js [js] -truncate('Hello World', 5) -``` - -**Returns:** Hello... - -### truncateWords - -Truncates a string by a number of words - -```js [js] -truncateWords('Hello World', 1) -``` - -**Returns:** Hello... - -### countWords - -Counts the number of words in a string. - -```js [js] -countWords('Hello World') -``` - -**Returns:** 2 - -### countCharacters - -Counts the number of characters in a string. - -```js [js] -countCharacters('Hello World') -``` - -**Returns:** 11 - -### countLines - -Counts the number of lines in a string. - -```js [js] -countLines('Hello World') -``` - -**Returns:** 1 - -### stripWhitespace - -Strips whitespace from a string. - -```js [js] -stripWhitespace('Hello World') -``` - -**Returns:** HelloWorld - -### stripNumbers - -Strips numbers from a string. - -```js [js] -stripNumbers('Hello World 123') -``` - -**Returns:** Hello World - -### stripPunctuation - -Strips punctuation from a string. - -```js [js] -stripPunctuation('Hello World!') -``` - -**Returns:** Hello World - -### stripSymbols - -Strips symbols from a string. - -```js [js] -stripSymbols('Hello World!') -``` - -**Returns:** Hello World - -### stripEmojis - -Strips emojis from a string (requires ES6 Unicode support) 🦊. - -```js [js] -stripEmojis('Hello World! 🦊') -``` - -**Returns:** Hello World! - -### readingTime - -Returns the reading time of a string in Hours, Minutes, and Seconds. - -```js [js] -readingTime('Once, in a vibrant online forum, lived Mod Max, guardian of digital harmony. Max cherished his old scooter, Swift, a symbol of freedom. Navigating both virtual and real worlds, they became legends. Trolls quivered, posts flourished, and lanes whizzed by. Swift’s wheels spun tales, and Max’s keys kept peace. Together, they discovered uncharted threads and hidden lanes. Their journey, an endless adventure, painted pixels and pavements with stories of unity and exhilaration, leaving a trail for all in the intertwined realms of screens and streets.') -``` - -**Returns:** 1 minute - -### pluralize - -Adds plurals to a string. - -```js [js] -pluralize('scooter', 10) -``` - -**Returns:** scooters - -### singularize - -Removes plurals from a string. - -```js [js] -singularize('scooters') -``` - -**Returns:** scooter - -### ordinalize - -Converts a number to a string with ordinal suffix. - -```js [js] -ordinalize(1) -``` - -**Returns:** 1st - -### humanize - -Replaces underscores with spaces and capitalizes the first letter of each word. - -```js [js] -humanize('hello_world') -``` - -**Returns:** Hello World - -### camelCase - -Removes spaces and capitalizes the first letter of each word except for the first word. - -```js [js] -camelCase('hello world') -``` - -**Returns:** helloWorld - -### pascalCase - -Removes spaces and capitalizes the first letter of each word. - -```js [js] -pascalCase('hello world') -``` - -**Returns:** HelloWorld - -### snakeCase - -Replaces spaces with underscores and converts to lowercase. - -```js [js] -snakeCase('hello world') -``` - -**Returns:** hello_world - -### kebabCase - -Replaces spaces with hyphens and converts to lowercase. - -```js [js] -titleize('Hello World') -``` - -**Returns:** hello-world - -### titleCase - -Converts to title case by capitalizing the first letter of each word. - -```js [js] -titleCase('hello world') -``` - -**Returns:** Hello World - -### sentenceCase - -Converts to sentence case by capitalizing the first letter of the first word. - -```js [js] -sentenceCase('hello world') -``` - -**Returns:** Hello world - -### startWith - -Adds a prefix to a string if it doesn't already start with the prefix. - -```js [js] -startWith('usemods.com', 'https://') -``` - -**Returns:** https://usemods.com - -### startWithout - -Removes a prefix from a string if it starts with the prefix. - -```js [js] -startWithout('https://usemods.com', 'https://') -``` - -**Returns:** usemods.com - -### endWith - -Adds a suffix to a string if it doesn't already end with the suffix. - -```js [js] -endWith('https://usemods', '.com') -``` - -**Returns:** https://usemods.com - -### endWithout - -Removes a suffix from a string if it ends with the suffix. - -```js [js] -endWithout('https://usemods.com.au', '.au') -``` - -**Returns:** https://usemods.com - -### surround - -Adds a prefix and suffix to a string if it doesn't already start and end with them. - -```js [js] -surround('https://', 'usemods', '.com') -``` - -**Returns:** https://usemods.com - -### title - -Converts a string to title case following the Chicago Manual of Style rules. - -```js [js] -title('the quick brown fox jumps over the lazy dog') -``` - -**Returns:** The Quick Brown Fox Jumps over the Lazy Dog - -### splitByWords - -Wraps each word in a string with a span tag. - -```js [js] -splitByWords('Hello World. How are you?') -``` - -**Returns:** Hello world. How are you? - -### list - -Creates an array of list items (`
  • `) from an array of strings. - -```js [js] -list(['one', 'two', 'three']) -``` - -**Returns:** - -### shuffle - -Shuffles an array. - -```js [js] -shuffle(['one', 'two', 'three']) -``` - -**Returns:** ['three', 'one', 'two'] - -Returns unique array values with an optional property to pluck. - -```js [js] -unique(['one', 'two', 'three', 'one']) -``` - -**Returns:** ['one', 'two', 'three'] - -### difference - -Returns the difference between two arrays. - -```js [js] -difference(['one', 'two', 'three'], ['one', 'two']) -``` - -**Returns:** ['three'] - -### first - -Returns the first item in an array. - -```js [js] -first(['one', 'two', 'three']) -``` - -**Returns:** one - -### last - -Returns the last item in an array. - -```js [js] -last(['one', 'two', 'three']) -``` - -**Returns:** three - -### nth - -Returns the nth item in an array. - -```js [js] -nth(['one', 'two', 'three'], 1) -``` - -**Returns:** two - -### offset - -Offset the first item in an array. - -```js [js] -offset(['one', 'two', 'three'], 1) -``` - -**Returns:** ['two', 'three'] - -Groups an array of objects by a property. - -```js [js] -group([{ name: 'one' }, { name: 'two' }, { name: 'one' }], 'name') -``` - -**Returns:** { one: [{ name: 'one' }, { name: 'one' }], two: [{ name: 'two' }] } - -### groupBy - -Chunks an array into sections of a specified size. - -```js [js] -chunk(['one', 'two', 'three', 'four', 'five'], 2) -``` - -**Returns:** [['one', 'two'], ['three', 'four'], ['five']] - -### flatten - -Flatten an array of arrays. - -```js [js] -flatten([['one', 'two'], ['three', 'four'], ['five']]) -``` - -**Returns:** ['one', 'two', 'three', 'four', 'five'] - -### without - -Returns an array with a filtered out property. - -```js [js] -without([{ name: 'one', food: 'apple' }, { name: 'two', food: 'grape' }, { name: 'one', food: 'pear' }], 'name') -``` - -**Returns:** [{ food: 'apple' }, { food: 'grape' }, { food: 'pear' }] - -### combine - -Combine two or more arrays - -```js [js] -combine(['one', 'two'], ['three', 'four'], ['five']) -``` - -**Returns:** ['one', 'two', 'three', 'four', 'five'] - -Combine two or more unique arrays - -```js [js] -combineUnique(['one', 'two'], ['three', 'four', 'two'], ['five', 'one']) -``` - -**Returns:** ['one', 'two', 'three', 'four', 'five'] - -Combine two or more arrays or objects without a property. - -```js [js] -combineWithout({ id: 1, name: 'A' }, { id: 2, name: 'B' }, { id: 3, name: 'C' }, 'id') -``` - -**Returns:** [1, 2, 3] - -### reverse - -Reverse an array. - -```js [js] -reverse(['one', 'two', 'three']) -``` - -**Returns:** ['three', 'two', 'one'] - -Sort an array by a property. - -```js [js] -sortBy([{ name: 'John', age: 25 },{ name: 'Jane', age: 30 },{ name: 'Jill', age: 20 }], 'age') -``` - -**Returns:** [{ name: 'Jill', age: 20 },{ name: 'John', age: 25 },{ name: 'Jane', age: 30 }] - diff --git a/content/2.functions/numbers.md b/content/2.functions/numbers.md deleted file mode 100644 index 9dc4a1ab..00000000 --- a/content/2.functions/numbers.md +++ /dev/null @@ -1,166 +0,0 @@ -This file contains functions that are related to numbers. - -### random - -Generates a random integer between the specified minimum and maximum values. - -```js [js] -random(1, 10) -``` - -**Returns:** 5 - -### sum - -Calculates the sum of an array of numbers. - -```js [js] -sum([1, 2, 3]) -``` - -**Returns:** 6 - -### mean - -Calculates the mean of an array of numbers. - -```js [js] -average([1, 2, 3]) -``` - -**Returns:** 2 - -### average - -Calculates the mean of an array of numbers. - -```js [js] -average([1, 2, 3]) -``` - -**Returns:** 2 - -### median - -Calculates the median of an array of numbers. - -```js [js] -median([1, 2, 3]) -``` - -**Returns:** 2 - -### mode - -Calculates the mode of an array of numbers. - -```js [js] -mode([1, 2, 2, 3]) -``` - -**Returns:** 2 - -### min - -Finds the minimum value in an array of numbers. - -```js [js] -min([1, 2, 3]) -``` - -**Returns:** 1 - -### max - -Finds the maximum value in an array of numbers. - -```js [js] -max([1, 2, 3]) -``` - -**Returns:** 3 - -### clamp - -Clamps a number between the specified minimum and maximum values. - -```js [js] -clamp(1, 10, 20) -``` - -**Returns:** 10 - -Returns the minimum and maximum values in an array of numbers. - -```js [js] -minMax([1, 2, 3, 4, 5]) -``` - -**Returns:** [1, 5] - -### range - -Returns the difference between two values, expressed as a positive number. - -```js [js] -range(-10, -20) -``` - -**Returns:** 10 - -### rangeAsPercentage - -Returns the difference between two values, as a percentage. - -```js [js] -differenceAsPercentage(10, 20) -``` - -**Returns:** 100 - -### percentage - -Returns the percentage of a value, relative to another value. - -```js [js] -percentage(10, 100) -``` - -**Returns:** 10 - -### standardDeviation - -Returns the standard deviation of an array of numbers. - -```js [js] -standardDeviation([1, 2, 3, 20, 120, 2000]) -``` - -**Returns:** 0.5 - -### skewness - -Returns the measure of asymmetry of the probability distribution of an array of numbers. - -```js [js] -skewness([1, 2, 3, 20, 120, 2000]) -``` - -**Returns:** 2.5 - -Return the frequency of all values (numbers, string or boolean) in an array as an object - -```js [js] -frequency([1, 3, 2, 3, 3, 3, 'a', 'b', 'c', 'c']) -``` - -**Returns:** { '1': 1, '2': 1, '3': 4, a: 1, b: 1, c: 2 } - -Returns the fequency of a property value in an array - -```js [js] -frequencyOfPropert([1, 3, 2, 3, 3, 3, 'a', 'b', 'c', 'c'], 3) -``` - -**Returns:** 4 - diff --git a/content/2.functions/validators.md b/content/2.functions/validators.md deleted file mode 100644 index e91b77f5..00000000 --- a/content/2.functions/validators.md +++ /dev/null @@ -1,444 +0,0 @@ -# Validators - -A collection of validators for common data types - -### isEmail - -Check if the input is a valid email address. - -```js [js] -isEmail('hello@usemods.com') -``` - -**Returns:** true - -### isNumber - -Check if the input is a valid number. - -```js [js] -isNumber('123') -``` - -**Returns:** true - -### isURL - -Check if the input is a valid URL. - -```js [js] -isURL('https://usemods.com') -``` - -**Returns:** true - -### isUUID - -Check if the input is a valid UUID. - -```js [js] -isUUID('c9bf9e57-1685-4c89-bafb-ff5af830be8a') -``` - -**Returns:** true - -### isJSON - -Check if the input is a valid JSON string. - -```js [js] -isJSON('{"hello": "world"}') -``` - -**Returns:** true - -### isHex - -Check if the input is a valid hexadecimal color code. - -```js [js] -isHex('#fff') -``` - -**Returns:** true - -### isEmpty - -Check if the input is an empty string. - -```js [js] -isEmpty('') -``` - -**Returns:** true - -### isAlpha - -Check if the input contains only alphabetic characters. - -```js [js] -isAlpha('hello') -``` - -**Returns:** true - -### isAlphanumeric - -Check if the input contains only alphanumeric characters. - -```js [js] -isAlphanumeric('hello123') -``` - -**Returns:** true - -### isArray - -Check if the input is an array. - -```js [js] -isArray([1, 2, 3]) -``` - -**Returns:** true - -### isObject - -Check if the input is an object. - -```js [js] -isObject({ hello: 'world' }) -``` - -**Returns:** true - -### isBoolean - -Check if the input is a boolean value. - -```js [js] -isBoolean(true) -``` - -**Returns:** true - -### isFunction - -Check if the input is a function. - -```js [js] -isFunction(() => {}) -``` - -**Returns:** true - -### isUndefined - -Check if the input is undefined. - -```js [js] -isUndefined(undefined) -``` - -**Returns:** true - -### isNull - -Check if the input is null. - -```js [js] -isNull(null) -``` - -**Returns:** true - -### isDate - -Check if the input is a valid Date object. - -```js [js] -isDate(new Date()) -``` - -**Returns:** true - -### isError - -Check if the input is an Error object with a defined message. - -```js [js] -isError(new Error('hello')) -``` - -**Returns:** true - -### isTime - -Check if the input is a valid time in HH:mm format. - -```js [js] -isTime('12:00') -``` - -**Returns:** true - -### isLeapYear - -Check if the input year is a leap year. - -```js [js] -isLeapYear(2020) -``` - -**Returns:** true - -### isPromise - -Check if the input is a Promise object. - -```js [js] -isPromise(new Promise(() => {})) -``` - -**Returns:** true - -### isSet - -Check if the input is a Set object. - -```js [js] -isSet(new Set()) -``` - -**Returns:** true - -### isMap - -Check if the input is a Map object. - -```js [js] -isMap(new Map()) -``` - -**Returns:** true - -### isEven - -Check if the number is even. - -```js [js] -isEven(2) -``` - -**Returns:** true - -### isOdd - -Check if the number is odd. - -```js [js] -isOdd(3) -``` - -**Returns:** true - -### isPositive - -Check if the number is positive. - -```js [js] -isPositive(1) -``` - -**Returns:** true - -### isNegative - -Check if the number is negative. - -```js [js] -isNegative(-1) -``` - -**Returns:** true - -### isZero - -Check if the number is zero. - -```js [js] -isZero(0) -``` - -**Returns:** true - -### isPrime - -Check if the number is a prime number. - -```js [js] -isPrime(7) -``` - -**Returns:** true - -### isOptimusPrime - -Check if the string is equal to "Optimus Prime". - -```js [js] -isOptimusPrime('Optimus Prime') -``` - -**Returns:** true - -### isPalindrome - -Check if the string is a palindrome. - -```js [js] -isPalindrome('racecar') -``` - -**Returns:** true - -### isInteger - -Check if the number is an integer. - -```js [js] -isInteger(1) -``` - -**Returns:** true - -### isFloat - -Check if the number is a float. - -```js [js] -isFloat(1.5) -``` - -**Returns:** true - -### isBetween - -Check if the number is between the specified range. - -```js [js] -isBetween(5, 1, 10) -``` - -**Returns:** true - -### isDivisibleBy - -Check if the number is divisible by the specified number. - -```js [js] -isDivisibleBy(10, 2) -``` - -**Returns:** true - -### isCreditCardNumber - -Check if the input is a valid credit card number. - -```js [js] -isCreditCardNumber('4242424242424242') -``` - -**Returns:** true - -### isIPAddress - -Check if the input is a valid IP address. - -```js [js] -isIPAddress('127.0.0.0') -``` - -**Returns:** true - -### isMACAddress - -Check if the input is a valid MAC address. - -```js [js] -isMACAddress('00:00:00:00:00:00') -``` - -**Returns:** true - -### isLatLng - -Check if the input is a valid latitude-longitude coordinate in the format lat,lng or lat,lng. - -```js [js] -isLatLng('40.741895,-73.989308') -``` - -**Returns:** true - -### isLatitude - -Check if the input is a valid latitude coordinate. - -```js [js] -isLatitude('40.741895') -``` - -**Returns:** true - -### isLongitude - -Check if the input is a valid longitude coordinate. - -```js [js] -isLongitude('-73.989308') -``` - -**Returns:** true - -### isPort - -Check if the input is a valid port number. - -```js [js] -isPort(3000) -``` - -**Returns:** true - -### isPresent - -Checks if a property and value pair exists in an object. - -```js [js] -hasPropertyValue({ hello: 'world' }, 'hello', 'world') -``` - -**Returns:** true - -### hasProperties - -Check if a property exists in an object without checking its value. - -```js [js] -hasProperties({ hello: 'world' }, ['hello', 'world']) -``` - -**Returns:** true - -### hasKeys - -Check if an array of key exists in an object - -```js [js] -hasKeys({ hello: 'world' }, ['hello', 'world',]) -``` - -**Returns:** true -