diff options
-rw-r--r-- | packages/astro/src/content/types-generator.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts index 66e5aef3c..b970eadb9 100644 --- a/packages/astro/src/content/types-generator.ts +++ b/packages/astro/src/content/types-generator.ts @@ -35,18 +35,18 @@ type DataEntryMetadata = Record<string, never>; type ContentEntryMetadata = { slug: string }; type CollectionEntryMap = { [collection: string]: - | { - type: 'unknown'; - entries: Record<string, never>; - } - | { - type: 'content'; - entries: Record<string, ContentEntryMetadata>; - } - | { - type: 'data'; - entries: Record<string, DataEntryMetadata>; - }; + | { + type: 'unknown'; + entries: Record<string, never>; + } + | { + type: 'content'; + entries: Record<string, ContentEntryMetadata>; + } + | { + type: 'data'; + entries: Record<string, DataEntryMetadata>; + }; }; type CreateContentGeneratorParams = { @@ -425,8 +425,8 @@ async function writeContentFiles({ const resolvedType: 'content' | 'data' = collection.type === 'unknown' ? // Add empty / unknown collections to the data type map by default - // This ensures `getCollection('empty-collection')` doesn't raise a type error - collectionConfig?.type ?? 'data' + // This ensures `getCollection('empty-collection')` doesn't raise a type error + collectionConfig?.type ?? 'data' : collection.type; const collectionEntryKeys = Object.keys(collection.entries).sort(); |