algolia / algolia/algoliasearch-client-javascript

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

Ouverte
#1,432 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
1.4k
Forks
227
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
api
Type d'issue
Bug
Difficulté
1/5
Temps estimé
Moins d'une heure
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.