Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

fix(types): improve conditional for client version #943

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion types/algoliasearch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import type * as AlgoliaSearch from 'algoliasearch';
import type * as ClientSearch from '@algolia/client-search';

// turns any to unknown, so it can be used as a conditional
type AnyToUnknown<T> = (any extends T ? true : false) extends true
// more info in https://stackoverflow.com/a/49928360/3185307
type AnyToUnknown<T> = (0 extends 1 & T ? true : false) extends true
? unknown
: T;

Expand Down