Using zod could help to validate objects before dealing with them. This should be implemented for all packages where required