From ea70d3cce2ce5ddfa041a18a39c5d8f7d359fe32 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 30 Apr 2023 11:37:23 -0500 Subject: [PATCH] Fix `extends undefined` checks --- src/features/tooltips/tooltip.ts | 2 +- src/game/modifiers.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/features/tooltips/tooltip.ts b/src/features/tooltips/tooltip.ts index 129bd16..b5b1042 100644 --- a/src/features/tooltips/tooltip.ts +++ b/src/features/tooltips/tooltip.ts @@ -52,7 +52,7 @@ export interface BaseTooltip { export type Tooltip = 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 : undefined; display: GetComputableType; classes: GetComputableType; diff --git a/src/game/modifiers.tsx b/src/game/modifiers.tsx index cceacd8..b65e7fc 100644 --- a/src/game/modifiers.tsx +++ b/src/game/modifiers.tsx @@ -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 extends undefined - ? S extends undefined +export type ModifierFromOptionalParams = undefined extends T + ? undefined extends S ? Omit, "description" | "enabled"> : Omit, "description"> - : S extends undefined + : undefined extends S ? Omit, "enabled"> : WithRequired;