File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2443,12 +2443,13 @@ added: v0.3.0
24432443* ` input ` {string}
24442444* Returns: {integer}
24452445
2446- Returns ` 6 ` if ` input ` is an IPv6 address. Returns ` 4 ` if ` input ` is an IPv4
2447- address in [ dot-decimal notation] [ ] with no leading zeroes. Otherwise, returns
2448- ` 0 ` .
2446+ Returns ` 6 ` if ` input ` is an IPv6 address, including an IPv4-mapped IPv6 address.
2447+ Returns ` 4 ` if ` input ` is an IPv4 address in [ dot-decimal notation] [ ] with no
2448+ leading zeroes. Otherwise, returns ` 0 ` .
24492449
24502450``` js
24512451net .isIP (' ::1' ); // returns 6
2452+ net .isIP (' ::ffff:127.0.0.1' ); // returns 6
24522453net .isIP (' 127.0.0.1' ); // returns 4
24532454net .isIP (' 127.000.000.001' ); // returns 0
24542455net .isIP (' 127.0.0.1/24' ); // returns 0
@@ -2483,10 +2484,12 @@ added: v0.3.0
24832484* ` input ` {string}
24842485* Returns: {boolean}
24852486
2486- Returns ` true ` if ` input ` is an IPv6 address. Otherwise, returns ` false ` .
2487+ Returns ` true ` if ` input ` is an IPv6 address, including an IPv4-mapped IPv6 address.
2488+ Otherwise, returns ` false ` .
24872489
24882490``` js
24892491net .isIPv6 (' ::1' ); // returns true
2492+ net .isIPv6 (' ::ffff:127.0.0.1' ); // returns true
24902493net .isIPv6 (' fhqwhgads' ); // returns false
24912494```
24922495
You can’t perform that action at this time.
0 commit comments