Skip to content

Commit

Permalink
fixup! net: make server.address() return an integer for family
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 8, 2022
1 parent 82e9aa9 commit 740a691
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function getCIDR(address, netmask, family) {
let groupLength = 8;
let hasZeros = false;

if (family === 'IPv6') {
if (family === 6) {
split = ':';
range = 16;
groupLength = 16;
Expand Down Expand Up @@ -248,7 +248,7 @@ function getCIDR(address, netmask, family) {
* @returns {Record<string, Array<{
* address: string
* netmask: string
* family: 'IPv4' | 'IPv6'
* family: 4 | 6
* mac: string
* internal: boolean
* scopeid: number
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ switch (platform) {
const expected = [{
address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
family: 4,
mac: '00:00:00:00:00:00',
internal: true,
cidr: '127.0.0.1/8'
Expand All @@ -154,7 +154,7 @@ switch (platform) {
const expected = [{
address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
family: 4,
mac: '00:00:00:00:00:00',
internal: true,
cidr: '127.0.0.1/8'
Expand Down

0 comments on commit 740a691

Please sign in to comment.