algolia / algolia/algoliasearch-client-javascript

Type error in searchOptions["facets"] which should also accept `string`

Aperta
#1,432 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
1.4k
Fork
226
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The current type of `facets` in the searchOptions is:

https://github.com/algolia/algoliasearch-client-javascript/blob/ba59b68aa9494c29e284ed45e924267d7388baa9/packages/client-search/src/types/SearchOptions.ts#L104

Nonetheless, while this is true when no facets are checked, once it is `facets` may contain a string.

Screenshot 2022-12-13 at 17 58 29

Screenshot 2022-12-13 at 17 58 40

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Open packages/client-search/src/types/SearchOptions.ts at the linked line and inspect the current type definition for searchOptions["facets"]. Confirm how the type represents facets when values are selected, then update the declaration so string values are accepted while preserving the existing forms; the work is done when the reported TypeScript error no longer occurs.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
api
Tipo di issue
Bug
Difficoltà
1/5
Tempo stimato
Meno di un'ora
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.