The former seems unnecessarily obtuse, what's the reason for it? Surely it's not performance given how many function calls you're adding
Tangentially related, but I'm thinking of Zod now. It's a library that allows you to define a schema and parse untrusted data. You can convert types and perform processing on individual fields. It's much more readable than your mapper