0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

fix(astro:content): add deprecated to getEntryBySlug & getDataEntryById (#11600)

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
This commit is contained in:
Armand Philippot 2024-08-02 16:31:32 +02:00 committed by GitHub
parent 1b3c81c684
commit 09ec2cadce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Deprecates `getEntryBySlug` and `getDataEntryById` functions exported by `astro:content` in favor of `getEntry`.

View file

@ -22,6 +22,7 @@ declare module 'astro:content' {
ContentEntryMap[C]
>['slug'];
/** @deprecated Use `getEntry` instead. */
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
@ -33,6 +34,7 @@ declare module 'astro:content' {
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
/** @deprecated Use `getEntry` instead. */
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E