From 773cfe3a1461518a41471db7f291b2066540b425 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Tue, 21 Nov 2023 14:55:17 -0500 Subject: [PATCH] Fix types for batches --- data.ts | 4 ++-- package-lock.json | 7 +++++++ package.json | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data.ts b/data.ts index d6324e6..7f439a4 100644 --- a/data.ts +++ b/data.ts @@ -17,7 +17,7 @@ import chunk from 'lodash/chunk' const jsonFilename = 'sandbox-search.json' const jsFilename = 'sandbox-search.js' -async function getData(path: string) { +async function getData(path: string): Promise { let result const jsonPath = join(path, jsonFilename) const jsPath = join(path, jsFilename) @@ -47,7 +47,7 @@ export async function populate(path: string, opts: ClientOptions) { const client = new Client(opts) const batch_size = 10 const batches = chunk(data, batch_size) - batches.forEach(async (batch: object[]) => { + batches.forEach(async (batch) => { await client.bulk({ body: batch }) }) } diff --git a/package-lock.json b/package-lock.json index b02e4ec..91d575b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "devDependencies": { "@nasa-gcn/eslint-config-gitignore": "^0.0.1", "@tsconfig/node14": "^1.0.3", + "@types/lodash": "^4.14.202", "@types/make-fetch-happen": "^10.0.1", "@types/node": "^18.13.0", "@types/tar": "^6.1.4", @@ -545,6 +546,12 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, + "node_modules/@types/lodash": { + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dev": true + }, "node_modules/@types/make-fetch-happen": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@types/make-fetch-happen/-/make-fetch-happen-10.0.1.tgz", diff --git a/package.json b/package.json index 209eaa0..f1ba9cf 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "devDependencies": { "@nasa-gcn/eslint-config-gitignore": "^0.0.1", "@tsconfig/node14": "^1.0.3", + "@types/lodash": "^4.14.202", "@types/make-fetch-happen": "^10.0.1", "@types/node": "^18.13.0", "@types/tar": "^6.1.4",