mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 00:04:22 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
|
||||
/**
|
||||
* Checks whether a IP Address string is valid.
|
||||
* @param ipaddress A string representing a potential IP Address
|
||||
*/
|
||||
export function isValidIPAddress(ipaddress: string): boolean {
|
||||
const byteRange = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
|
||||
const regexStr = `^${byteRange}\.${byteRange}\.${byteRange}\.${byteRange}$`;
|
||||
const ipAddressRegex = new RegExp(regexStr);
|
||||
const byteRange = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
|
||||
const regexStr = `^${byteRange}\.${byteRange}\.${byteRange}\.${byteRange}$`;
|
||||
const ipAddressRegex = new RegExp(regexStr);
|
||||
|
||||
return ipAddressRegex.test(ipaddress);
|
||||
return ipAddressRegex.test(ipaddress);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user