From b3f8308590526ce231b1c6d5a35d24e73f855caa Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Thu, 9 Jan 2020 15:29:08 -0500 Subject: [PATCH] Fixes lodash destructure change so methods are correctly called in code --- .../adapters/log_entries/kibana_log_entries_adapter.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts b/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts index 79fa19cf7241b..e7b1692547ead 100644 --- a/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts +++ b/x-pack/plugins/infra/server/lib/adapters/log_entries/kibana_log_entries_adapter.ts @@ -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'); } @@ -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; @@ -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 }