Skip to content

Commit

Permalink
Fix types for batches
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger authored and ronitagarwala01 committed Nov 22, 2023
1 parent 88c5969 commit 773cfe3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<object[]> {
let result
const jsonPath = join(path, jsonFilename)
const jsPath = join(path, jsFilename)
Expand Down Expand Up @@ -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 })
})
}
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 773cfe3

Please sign in to comment.