diff --git a/x-pack/plugins/endpoint/scripts/resolver_generator.ts b/x-pack/plugins/endpoint/scripts/resolver_generator.ts index de059d654b9056..d50f3b09d400d2 100644 --- a/x-pack/plugins/endpoint/scripts/resolver_generator.ts +++ b/x-pack/plugins/endpoint/scripts/resolver_generator.ts @@ -147,9 +147,12 @@ async function main() { argv.percentWithRelated, argv.percentTerminated ); - const body = resolverDocs - .map(doc => [{ index: { _index: argv.eventIndex } }, doc]) - .reduce((array, value) => (array.push(...value), array), []); + const body = resolverDocs.reduce( + (array: Array>, doc) => ( + array.push({ index: { _index: argv.eventIndex } }, doc), array + ), + [] + ); await client.bulk({ body }); }