From e329c89db31ff7529e0ef00acd738a8e59ad9074 Mon Sep 17 00:00:00 2001 From: Luke Abby Date: Fri, 3 Jan 2025 02:07:04 -0800 Subject: [PATCH] Fix __UnsetDocument case in FromUuidValidate --- src/foundry/client/core/utils.d.mts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/foundry/client/core/utils.d.mts b/src/foundry/client/core/utils.d.mts index d57e49e5c..1bd0ee686 100644 --- a/src/foundry/client/core/utils.d.mts +++ b/src/foundry/client/core/utils.d.mts @@ -15,13 +15,15 @@ type FromUuid = Uuid extends `${string}.${string}.${infer R ? Document.ConfiguredInstanceForName : InvalidUuid; -// TODO(LukeAbby): The condition `ConcreteDocument extends __UnsetDocument` will not be necessary once `Document.Any` is more type safe. +// TODO(LukeAbby): The usage of `Document.Type` when it's unset will not be necessary once `Document.Any` is more type safe. type FromUuidValidate< ConcreteDocument extends Document.Any, Uuid extends string, -> = ConcreteDocument extends __UnsetDocument - ? MustBeValidUuid // Only necessary because `Document.Any` is of type `any` not `Document.Type`. - : MustBeValidUuid; +> = __UnsetDocument extends ConcreteDocument + ? MustBeValidUuid + : string extends Uuid + ? string + : MustBeValidUuid; declare global { /**