From 6821d9c0c8aadfd4ce986dc24957ed56c14b309f Mon Sep 17 00:00:00 2001 From: samchungy Date: Thu, 9 May 2024 15:34:58 +1000 Subject: [PATCH] update nesting --- src/cli/configure/ensureTemplateCompletion.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/configure/ensureTemplateCompletion.ts b/src/cli/configure/ensureTemplateCompletion.ts index 20265c6f6..ffd298fe7 100644 --- a/src/cli/configure/ensureTemplateCompletion.ts +++ b/src/cli/configure/ensureTemplateCompletion.ts @@ -26,7 +26,7 @@ interface Props { manifest: NormalizedReadResult; } -const recordSchema = z.record(z.string()); +const recordSchema = z.object({ templateData: z.record(z.string()) }); const getTemplateDataFromStdIn = async ( templateConfig: TemplateConfig, @@ -35,7 +35,7 @@ const getTemplateDataFromStdIn = async ( const data = recordSchema.parse(config); templateConfig.fields.forEach((field) => { - const value = data[field.name]; + const value = data.templateData[field.name]; if (value === undefined) { throw new Error(`Missing field: ${field.name}`); } @@ -45,7 +45,7 @@ const getTemplateDataFromStdIn = async ( } }); - return data; + return data.templateData; }; export const ensureTemplateCompletion = async ({