File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1976,12 +1976,13 @@ added: v0.3.0
19761976* ` input ` {string}
19771977* Returns: {integer}
19781978
1979- Returns ` 6 ` if ` input ` is an IPv6 address. Returns ` 4 ` if ` input ` is an IPv4
1980- address in [ dot-decimal notation] [ ] with no leading zeroes. Otherwise, returns
1981- ` 0 ` .
1979+ Returns ` 6 ` if ` input ` is an IPv6 address or an IPv4 address mapped to IPv6.
1980+ Returns ` 4 ` if ` input ` is an IPv4 address in [ dot-decimal notation] [ ] with no
1981+ leading zeroes. Otherwise, returns ` 0 ` .
19821982
19831983``` js
19841984net .isIP (' ::1' ); // returns 6
1985+ net .isIP (' ::ffff:127.0.0.1' ); // returns 6
19851986net .isIP (' 127.0.0.1' ); // returns 4
19861987net .isIP (' 127.000.000.001' ); // returns 0
19871988net .isIP (' 127.0.0.1/24' ); // returns 0
@@ -2016,10 +2017,12 @@ added: v0.3.0
20162017* ` input ` {string}
20172018* Returns: {boolean}
20182019
2019- Returns ` true ` if ` input ` is an IPv6 address. Otherwise, returns ` false ` .
2020+ Returns ` true ` if ` input ` is an IPv6 address or an IPv4 address mapped to IPv6.
2021+ Otherwise, returns ` false ` .
20202022
20212023``` js
20222024net .isIPv6 (' ::1' ); // returns true
2025+ net .isIPv6 (' ::ffff:127.0.0.1' ); // returns true
20232026net .isIPv6 (' fhqwhgads' ); // returns false
20242027```
20252028
You can’t perform that action at this time.
0 commit comments