Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored and astrobot-houston committed Jan 9, 2023
1 parent 0be2d0d commit a673239
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/docs/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/src/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
12 changes: 6 additions & 6 deletions examples/with-content/src/content/types.generated.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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']>
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
}

/** Union type of supported markdown file extensions */
type MarkdowFileExtension = typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS[number];
type MarkdowFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number];

export interface AstroGlobalPartial {
/**
Expand Down
12 changes: 6 additions & 6 deletions packages/astro/src/content/template/types.generated.d.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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']>
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/core/errors/errors-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,5 +613,5 @@ See https://docs.astro.build/en/guides/server-side-rendering/ for more informati

type ValueOf<T> = T[keyof T];
export type AstroErrorCodes = ValueOf<{
[T in keyof typeof AstroErrorData]: typeof AstroErrorData[T]['code'];
[T in keyof typeof AstroErrorData]: (typeof AstroErrorData)[T]['code'];
}>;

0 comments on commit a673239

Please sign in to comment.