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:
parent
c17a364b10
commit
072492982b
2 changed files with 8 additions and 1 deletions
5
.changeset/fuzzy-bats-try.md
Normal file
5
.changeset/fuzzy-bats-try.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Includes "undefined" in types for getEntry
|
4
packages/astro/templates/content/types.d.ts
vendored
4
packages/astro/templates/content/types.d.ts
vendored
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue