From 97e5a607ba10d155ee49cfcfb7ffc107db56d533 Mon Sep 17 00:00:00 2001 From: cnagadya Date: Fri, 4 Nov 2022 10:08:00 +0000 Subject: [PATCH] Handle getContent response as is Co-authored-by: Henri Maurer --- src/config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index aca8bf2..6154fb0 100644 --- a/src/config.ts +++ b/src/config.ts @@ -168,8 +168,9 @@ async function getRemoteConfig(configFile: string): Promise { if (data === undefined) { throw new Error('Invalid content') } - console.log('Checking data value', data, data === 'fail-on-severity: low\n') - return data as unknown as string + // When using mediaType.format = 'raw', the response.data is a string but this is not reflected + // in the return type of getContent. So we're casting the return value to a string. + return z.string().parse(data as unknown) } catch (error) { throw error }