Skip to content

Commit

Permalink
Fixes lodash destructure change so methods are correctly called in code
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonrhodes committed Jan 9, 2020
1 parent 4d944a9 commit b3f8308
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class InfraKibanaLogEntriesAdapter implements LogEntriesAdapter {
};

const response = await search(params);
const document = _.first(response.hits.hits);
const document = first(response.hits.hits);
if (!document) {
throw new Error('Document not found');
}
Expand Down Expand Up @@ -310,7 +310,7 @@ export class InfraKibanaLogEntriesAdapter implements LogEntriesAdapter {
function getLookupIntervals(start: number, direction: 'asc' | 'desc'): Array<[number, number]> {
const offsetSign = direction === 'asc' ? 1 : -1;
const translatedOffsets = LOOKUP_OFFSETS.map(offset => start + offset * offsetSign);
const intervals = _.zip(translatedOffsets.slice(0, -1), translatedOffsets.slice(1)) as Array<
const intervals = zip(translatedOffsets.slice(0, -1), translatedOffsets.slice(1)) as Array<
[number, number]
>;
return intervals;
Expand All @@ -322,10 +322,10 @@ const convertHitToLogEntryDocument = (fields: string[]) => (
gid: hit._id,
fields: fields.reduce(
(flattenedFields, fieldName) =>
_.has(hit._source, fieldName)
has(hit._source, fieldName)
? {
...flattenedFields,
[fieldName]: _.get(hit._source, fieldName),
[fieldName]: get(hit._source, fieldName),
}
: flattenedFields,
{} as { [fieldName: string]: string | number | object | boolean | null }
Expand Down

0 comments on commit b3f8308

Please sign in to comment.