Utility to map one JavaScript object to another