Fix extends undefined checks

This commit is contained in:
thepaperpilot 2023-04-30 11:37:23 -05:00
parent 5d17d67e00
commit 04f14c17bd
2 changed files with 4 additions and 4 deletions

View file

@ -52,7 +52,7 @@ export interface BaseTooltip {
export type Tooltip<T extends TooltipOptions> = Replace<
T & BaseTooltip,
{
pinnable: T["pinnable"] extends undefined ? false : T["pinnable"];
pinnable: undefined extends T["pinnable"] ? false : T["pinnable"];
pinned: T["pinnable"] extends true ? Ref<boolean> : undefined;
display: GetComputableType<T["display"]>;
classes: GetComputableType<T["classes"]>;

View file

@ -41,11 +41,11 @@ export interface Modifier {
/**
* Utility type used to narrow down a modifier type that will have a description and/or enabled property based on optional parameters, T and S (respectively).
*/
export type ModifierFromOptionalParams<T, S> = T extends undefined
? S extends undefined
export type ModifierFromOptionalParams<T, S> = undefined extends T
? undefined extends S
? Omit<WithRequired<Modifier, "invert" | "getFormula">, "description" | "enabled">
: Omit<WithRequired<Modifier, "invert" | "enabled" | "getFormula">, "description">
: S extends undefined
: undefined extends S
? Omit<WithRequired<Modifier, "invert" | "description" | "getFormula">, "enabled">
: WithRequired<Modifier, "invert" | "enabled" | "description" | "getFormula">;