Skip to content

Commit

Permalink
- pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-goldstein committed May 20, 2022
1 parent 7a9fab8 commit 606927c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,14 @@ export const getColumnHeaders = (
return headers
? headers.map((header) => {
const splitHeader = header.id.split('.'); // source.geo.city_name -> [source, geo, city_name]
const category =
splitHeader.length > 1
? splitHeader[0]
: getRootCategory({ field: header.id, browserFields });

return {
...header,
...get(
[
splitHeader.length > 1
? splitHeader[0]
: getRootCategory({ field: header.id, browserFields }),
'fields',
header.id,
],
browserFields
),
...get([category, 'fields', header.id], browserFields),
};
})
: [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('helpers', () => {
]);
});

test('it defaults to a `columnType` of empty string when a column does NOT has a corresponding entry in `columnHeaders`', () => {
test('it defaults to a `columnType` of empty string when a column does NOT have a corresponding entry in `columnHeaders`', () => {
const withUnknownColumn: Array<{
id: string;
direction: 'asc' | 'desc';
Expand Down

0 comments on commit 606927c

Please sign in to comment.