We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eaca48e + 2e52efe commit 518a663Copy full SHA for 518a663
1 file changed
src/lib/isIP.js
@@ -51,14 +51,10 @@ export default function isIP(str, version = '') {
51
return isIP(str, 4) || isIP(str, 6);
52
}
53
if (version === '4') {
54
- if (!IPv4AddressRegExp.test(str)) {
55
- return false;
56
- }
57
- const parts = str.split('.').sort((a, b) => a - b);
58
- return parts[3] <= 255;
+ return IPv4AddressRegExp.test(str);
59
60
if (version === '6') {
61
- return !!IPv6AddressRegExp.test(str);
+ return IPv6AddressRegExp.test(str);
62
63
return false;
64
0 commit comments