From dead1181ed32e0e440fa7a3fdebc5b5facdf2f89 Mon Sep 17 00:00:00 2001 From: invakid404 Date: Mon, 18 Nov 2024 11:21:23 +0200 Subject: [PATCH] fix: ignore missing resource types from map --- src/generator/resources.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/generator/resources.ts b/src/generator/resources.ts index cf02b6a..8ef0ab1 100644 --- a/src/generator/resources.ts +++ b/src/generator/resources.ts @@ -29,15 +29,16 @@ export const generateResources = async () => { resource_type: resourceTypeName, path, } of listResources()) { + if (!(resourceTypeName in allResourceTypes)) { + continue; + } + const paths = resourcesByType.get(resourceTypeName) ?? []; resourcesByType.set(resourceTypeName, [...paths, path]); } for (const [resourceTypeName, paths] of resourcesByType) { const resourceType = allResourceTypes[resourceTypeName]!; - if (resourceType == null) { - continue; - } const typeSchemaName = resourceTypeSchemaName(resourceType.name); const resourceTypeSchema = schemaToZod(resourceType.schema as never, {