mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
fix(astro): duplicated brackets are generated in data collections. (#11275)
* fix(astro): duplicated brackets are generated in data collections. This PR fixed #11274 * Create duplicated-brackets-generation.md
This commit is contained in:
parent
83c565b36c
commit
bab700d690
2 changed files with 6 additions and 1 deletions
5
.changeset/duplicated-brackets-generation.md
Normal file
5
.changeset/duplicated-brackets-generation.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Drop duplicated brackets in data collections schema generation.
|
|
@ -449,7 +449,6 @@ async function writeContentFiles({
|
|||
for (const entryKey of Object.keys(collection.entries).sort()) {
|
||||
const dataType = collectionConfig?.schema ? `InferEntrySchema<${collectionKey}>` : 'any';
|
||||
dataTypesStr += `${entryKey}: {\n id: ${entryKey};\n collection: ${collectionKey};\n data: ${dataType}\n};\n`;
|
||||
dataTypesStr += `};\n`;
|
||||
}
|
||||
|
||||
if (settings.config.experimental.contentCollectionJsonSchema && collectionConfig?.schema) {
|
||||
|
@ -482,6 +481,7 @@ async function writeContentFiles({
|
|||
);
|
||||
}
|
||||
}
|
||||
dataTypesStr += `};\n`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue