@azizbecha/strkit
Version:
strkit is a utility library offering a collection of essential string functions including validation, case conversion, truncation, and more. Ideal for both JavaScript and TypeScript developers to simplify string operations in their applications.
13 lines (12 loc) • 442 B
TypeScript
/**
* Validates whether a given string is a valid IPv4 address.
*
* @param str - The string to check if it's a valid IPv4 address.
* @returns A boolean indicating whether the string is a valid IPv4 address.
*
* @example
* isIPv4Address("192.168.1.1"); // Output: true
* isIPv4Address("256.256.256.256"); // Output: false
* isIPv4Address("not-an-ip"); // Output: false
*/
export default function isIPv4Address(str: string): boolean;