Again (like in Is there a way to truncate the values in the path data?), I think that that’s something that’s up to the developers (and maybe libraries) to achieve this. This sort of type-checking is already possible (I’ve also written a little library to achieve this which I plan to make open-source soon), so that’s really nothing that belongs in the “native” APIs (since it’d only clutter up the API with things we can achieve without any further functionality). For more thoughts about why something like this shouldn’t get done in my opinion, see my comment on the linked request
)