Skip to content

Commit

Permalink
refactor: Better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
paultranvan committed Oct 21, 2024
1 parent d618b96 commit 811b02c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/dataproxy/worker/shared-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,12 @@ const updateState = (): void => {

if (client && searchEngine && searchEngine.searchIndexes) {
state.status = 'Ready'
state.indexLength = Object.keys(searchEngine.searchIndexes).map(
(indexKey: string) => ({
doctype: indexKey,
state.indexLength = Object.entries(searchEngine.searchIndexes).map(
([doctype, searchIndex]) => ({
doctype,
// @ts-expect-error index.store is not TS typed
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
count: Object.keys(searchEngine.searchIndexes[indexKey].index.store)
.length
count: Object.keys(searchIndex.index.store).length
})
)
broadcastChannel.postMessage(state)
Expand Down

0 comments on commit 811b02c

Please sign in to comment.