Skip to content

Commit

Permalink
linter changes
Browse files Browse the repository at this point in the history
Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy committed Jan 21, 2025
1 parent 472e338 commit 380ea4d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions server/routes/utils/__tests__/savedSearchReportHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -937,12 +937,10 @@ describe('test create saved search report', () => {
}
),
];

const client = mockOpenSearchClient(
hits,
'"geoip.country_iso_code", "geoip.city_name", "geoip.location"'
);

const { dataUrl } = await createSavedSearchReport(
input,
client,
Expand Down
4 changes: 0 additions & 4 deletions server/routes/utils/dataReportHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,15 @@ function traverse(data: any, keys: string[], result: { [key: string]: any } = {}
keys.forEach((key) => {
const value = _.get(data, key, undefined);

// If the key exists, directly assign the value to the result
if (value !== undefined) {
result[key] = value;
} else {
// If the key doesn't exist directly, check for any partial matches in the flattened data
Object.keys(data)
.filter((sourceKey) => sourceKey.startsWith(key + '.'))
.forEach((sourceKey) => {
result[sourceKey] = data[sourceKey];
});

// Check for arrays and flatten their contents into appropriate result keys
Object.keys(data).forEach((dataKey) => {
const arrayValue = data[dataKey];

Expand All @@ -341,7 +338,6 @@ function traverse(data: any, keys: string[], result: { [key: string]: any } = {}
});
}
});
console.log(result);
return result;
}

Expand Down

0 comments on commit 380ea4d

Please sign in to comment.