This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): improve conditional for client version (#943)
* fix(types): improve conditional for client version in TypeScript 5.1.3, the check `any extends T` when T is any no longer evaluates to one branch of the conditional, but the union of both branches. This is fixed by using a "never possible to be true, unless T is any" condition as in https://stackoverflow.com/a/49928360/3185307 fixes algolia/instantsearch#5658 FX-2396 * chore(dev): update typescript this showed the error before the previous commit as ``` test/types.ts:16:7 - error TS2345: Argument of type '{ query: string; }' is not assignable to parameter of type 'PlainSearchParameters'. Object literal may only specify known properties, and 'query' does not exist in type 'PlainSearchParameters'. 16 query: 'something fun', ~~~~~ Found 1 error in test/types.ts:16 error Command failed with exit code 2. ```
- Loading branch information