From 3305eff3c2760918c429bba59fec20759d9965c5 Mon Sep 17 00:00:00 2001 From: Ryan Govostes Date: Mon, 10 Jun 2024 04:16:22 -0700 Subject: [PATCH] Minor cleanup in the content types generator (#11218) --- packages/astro/src/content/types-generator.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/content/types-generator.ts b/packages/astro/src/content/types-generator.ts index 1192d2b4ed..31c1e67e70 100644 --- a/packages/astro/src/content/types-generator.ts +++ b/packages/astro/src/content/types-generator.ts @@ -121,16 +121,14 @@ export async function createContentTypesGenerator({ switch (event.name) { case 'addDir': - collectionEntryMap[JSON.stringify(collection)] = { + collectionEntryMap[collectionKey] = { type: 'unknown', entries: {}, }; logger.debug('content', `${cyan(collection)} collection added`); break; case 'unlinkDir': - if (collectionKey in collectionEntryMap) { - delete collectionEntryMap[JSON.stringify(collection)]; - } + delete collectionEntryMap[collectionKey]; break; } return { shouldGenerateTypes: true };