diff options
author | 2024-12-03 16:16:42 +0000 | |
---|---|---|
committer | 2024-12-03 16:16:42 +0000 | |
commit | 072492982b338e04549ee576ca7d8480be92cc1c (patch) | |
tree | a21ba41c21c6bd062ee3cdc88dd2590a948433ee /packages | |
parent | c17a364b1060a5afb383b75e3fc05892ab3e54f5 (diff) | |
download | astro-072492982b338e04549ee576ca7d8480be92cc1c.tar.gz astro-072492982b338e04549ee576ca7d8480be92cc1c.tar.zst astro-072492982b338e04549ee576ca7d8480be92cc1c.zip |
fix: include undefined in types for getEntry with content layer (#12601)
Diffstat (limited to 'packages')
-rw-r--r-- | packages/astro/templates/content/types.d.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/astro/templates/content/types.d.ts b/packages/astro/templates/content/types.d.ts index 0727ac2e5..14b57053c 100644 --- a/packages/astro/templates/content/types.d.ts +++ b/packages/astro/templates/content/types.d.ts @@ -92,7 +92,9 @@ declare module 'astro:content' { collection: C, id: E, ): E extends keyof DataEntryMap[C] - ? Promise<DataEntryMap[C][E]> + ? string extends keyof DataEntryMap[C] + ? Promise<DataEntryMap[C][E]> | undefined + : Promise<DataEntryMap[C][E]> : Promise<CollectionEntry<C> | undefined>; /** Resolve an array of entry references from the same collection */ |