Friendly tips: you can replace any with unknown.
Other friendly tips: runtime type checks are available
https://github.com/gcanti/io-ts
https://github.com/pelotom/runtypes
2nd it's more convenient for both the end-user and the developers that errors are handled this way