In the end, nobody replied to the question. You need to use a type guard for this. It is when static typing becomes dynamic. You have to manually check each field in the payload by typeof. Check the official docs.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.