bestiejs / platform.js

A platform detection library.
https://mths.be/platform
MIT License
3.22k stars 408 forks source link

Fix Platform typings #187

Open droganov opened 4 years ago

droganov commented 4 years ago

In our logs I've found a situation when we received userAgent string:

[FBAN/FB4A;FBAV/279.0.0.43.120;FBBV/231020957;FBDM/{density=2.75,width=1080,height=2150};FBLC/en_GB;FBRV/0;FBCR/Jio 4G;FBMF/Xiaomi;FBBD/xiaomi;FBPN/com.facebook.katana;FBDV/Redmi Note 6 Pro;FBSV/8.1.0;FBOP/1;FBCA/armeabi-v7a:armeabi;]

Which was parsed as { name: 'Xiaomi Browser', version: null,}

From Platform interface it's known that version?: string;can not be null

bnjmnt4n commented 3 years ago

The platform.js typings are currently not maintained by us. Although I might decide to shift them into this repo in the future, for now this should be opened at DefinitelyTyped. I'll look into that sometime soon.