homebridge / ciao

RFC 6762 and RFC 6763 compliant mdns service discovery library written in Typescript
MIT License
79 stars 6 forks source link

Fix #18 - Node.js v18 os.networkInterfaces()[].family number/string c… #25

Closed oznu closed 2 years ago

oznu commented 2 years ago

:recycle: Current situation

https://github.com/nodejs/node/issues/42787 https://github.com/nodejs/node/pull/41431#discussion_r841277378

:bulb: Proposed solution

It's worth doing this sooner rather than later. There may be other compatibility issues in Node.js 18 we won't find until this one is patched.

The use of @ts-expect-error should alert us to remove the exception when @types/node is updated to 18 (if they decide to keep backwards compatibility with old versions, which they may not, be we need to).

Alternatively we could do something like this, but I feel like it will result in the exception never being removed in the future:

(info.family === "IPv6" || (info.family as unknown as string) === 6)

:gear: Release Notes

Reviewer Nudging

@Supereg

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2230313822


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/NetworkManager.ts 0 3 0.0%
<!-- Total: 0 3 0.0% -->
Totals Coverage Status
Change from base Build 1491628923: -0.04%
Covered Lines: 1200
Relevant Lines: 3047

💛 - Coveralls