Transforming data from an API using Typescript and Lodash
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote 3 down vote favorite As a front-end developer, I am given the following result from an API, an array of objects that looks like: [ Color: "#065b79", GroupName: "VXYZ", QuoteCount: 4, SortOrder: 0, TabCategoryID: "CHSI1", TabCategoryName: "Workers' Compensation", TabCategoryOrder: 0, TabID: 1, TabName: "new" ] I need to display the data in a more hierarchical/nested format: [ GroupName: 'VXYZ', TabCategories: [ TabCategoryID: 'CHSI1', TabCategoryName: "Workers' Compensation", TabCategoryOrder: 0, Tabs: [ Color: '#065b79', SortOrder: 0, TabID: 1, TabName: 'new', QuoteCount: 4 ] ] ] Any data in an array can have any number of array items. In the models above, I just use a single instance of each array item. This is the cod...