0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: include undefined in types for getEntry with content layer (#12601)

This commit is contained in:
Matt Kane 2024-12-03 16:16:42 +00:00 committed by GitHub
parent c17a364b10
commit 072492982b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Includes "undefined" in types for getEntry

View file

@ -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 */