onsip / SIP.js

A simple, intuitive, and powerful JavaScript signaling library
https://sipjs.com
MIT License
1.84k stars 693 forks source link

NameAddrHeader.displayName has incorrect type #1040

Open RamsayRomero opened 1 year ago

RamsayRomero commented 1 year ago

Describe the bug The return type of the get displayName() method on the NameAddrHeader class is typed as string. However, the displayName could be undefined so it should be typed as string | undefined.

Additional context My app was crashing in production because I was accessing string methods on the displayName property assuming it would always be a string but it turned out to be undefined.