File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -713,7 +713,8 @@ export class HAPConnection extends EventEmitter {
713713
714714 if ( ipVersion === "ipv4" ) {
715715 for ( const info of infos ) {
716- if ( info . family === "IPv4" ) {
716+ // @ts -expect-error Nodejs 18+ uses the number 4 the string "IPv4"
717+ if ( info . family === "IPv4" || info . family === 4 ) {
717718 return info . address ;
718719 }
719720 }
@@ -723,7 +724,8 @@ export class HAPConnection extends EventEmitter {
723724 let localUniqueAddress : string | undefined = undefined ;
724725
725726 for ( const info of infos ) {
726- if ( info . family === "IPv6" ) {
727+ // @ts -expect-error Nodejs 18+ uses the number 6 instead of the string "IPv6"
728+ if ( info . family === "IPv6" || info . family === 6 ) {
727729 if ( ! info . scopeid ) {
728730 return info . address ;
729731 } else if ( ! localUniqueAddress ) {
Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ export function findLoopbackAddress(): string {
1313 }
1414
1515 internal = true ;
16- if ( info . family === "IPv4" ) {
16+ // @ts -expect-error Nodejs 18+ uses the number 4 the string "IPv4"
17+ if ( info . family === "IPv4" || info . family === 4 ) {
1718 if ( ! ipv4 ) {
1819 ipv4 = info . address ;
1920 }
20- } else if ( info . family === "IPv6" ) {
21+ // @ts -expect-error Nodejs 18+ uses the number 6 the string "IPv6"
22+ } else if ( info . family === "IPv6" || info . family === 6 ) {
2123 if ( info . scopeid ) {
2224 if ( ! ipv6LinkLocal ) {
2325 ipv6LinkLocal = info . address + "%" + name ; // ipv6 link local addresses are only valid with a scope
You can’t perform that action at this time.
0 commit comments