summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/docs/src/config.ts2
-rw-r--r--examples/docs/src/languages.ts2
-rw-r--r--examples/with-content/src/content/types.generated.d.ts12
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/docs/src/config.ts b/examples/docs/src/config.ts
index 8ca1b577c..744c93ca1 100644
--- a/examples/docs/src/config.ts
+++ b/examples/docs/src/config.ts
@@ -42,7 +42,7 @@ export const ALGOLIA = {
};
export type Sidebar = Record<
- typeof KNOWN_LANGUAGE_CODES[number],
+ (typeof KNOWN_LANGUAGE_CODES)[number],
Record<string, { text: string; link: string }[]>
>;
export const SIDEBAR: Sidebar = {
diff --git a/examples/docs/src/languages.ts b/examples/docs/src/languages.ts
index 405b6921c..b44d2ba86 100644
--- a/examples/docs/src/languages.ts
+++ b/examples/docs/src/languages.ts
@@ -6,5 +6,5 @@ export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
export function getLanguageFromURL(pathname: string) {
const langCodeMatch = pathname.match(langPathRegex);
const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
- return langCode as typeof KNOWN_LANGUAGE_CODES[number];
+ return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
}
diff --git a/examples/with-content/src/content/types.generated.d.ts b/examples/with-content/src/content/types.generated.d.ts
index 906aabb75..a5247b7e4 100644
--- a/examples/with-content/src/content/types.generated.d.ts
+++ b/examples/with-content/src/content/types.generated.d.ts
@@ -1,7 +1,7 @@
declare module 'astro:content' {
export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof typeof entryMap> =
- typeof entryMap[C][keyof typeof entryMap[C]] & Render;
+ (typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render;
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
schema?: S;
@@ -17,17 +17,17 @@ declare module 'astro:content' {
input: BaseCollectionConfig<S>
): BaseCollectionConfig<S>;
- export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
+ export function getEntry<C extends keyof typeof entryMap, E extends keyof (typeof entryMap)[C]>(
collection: C,
entryKey: E
- ): Promise<typeof entryMap[C][E] & Render>;
+ ): Promise<(typeof entryMap)[C][E] & Render>;
export function getCollection<
C extends keyof typeof entryMap,
- E extends keyof typeof entryMap[C]
+ E extends keyof (typeof entryMap)[C]
>(
collection: C,
- filter?: (data: typeof entryMap[C][E]) => boolean
- ): Promise<(typeof entryMap[C][E] & Render)[]>;
+ filter?: (data: (typeof entryMap)[C][E]) => boolean
+ ): Promise<((typeof entryMap)[C][E] & Render)[]>;
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>