Eh, gods, this one bothered me a fair bit. At work our API returns some data that I’ve found I have to remap. As it happens with any organically-grown system, there are a number of small inconsistencies between different objects with similar attributes. For example:

I want to map all of these consistently so I could call (say) foo.ices.type. For this I found schm’s translate method through a founder’s blog post. Using Lodash’s _.set to go with _.get, I can set arbitrary paths as well as being able to read from them: