From b2fe34150a0d896f1755ca30cbe89175cdb66ff2 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Mon, 4 Sep 2023 19:02:03 +0200 Subject: [PATCH] fix(parameters): return type when options without transform is used (#1671) --- packages/parameters/src/types/AppConfigProvider.ts | 2 ++ packages/parameters/src/types/SecretsProvider.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/parameters/src/types/AppConfigProvider.ts b/packages/parameters/src/types/AppConfigProvider.ts index 6bfc26ecb9..b16b5156a5 100644 --- a/packages/parameters/src/types/AppConfigProvider.ts +++ b/packages/parameters/src/types/AppConfigProvider.ts @@ -107,6 +107,8 @@ type AppConfigGetOutput< InferredFromOptionsType = undefined > = undefined extends ExplicitUserProvidedType ? undefined extends InferredFromOptionsType | AppConfigGetOptionsTransformNone + ? Uint8Array + : InferredFromOptionsType extends AppConfigGetOptionsTransformNone ? Uint8Array : InferredFromOptionsType extends AppConfigGetOptionsTransformBinary ? string diff --git a/packages/parameters/src/types/SecretsProvider.ts b/packages/parameters/src/types/SecretsProvider.ts index 94af356f3a..a9e5c1ef98 100644 --- a/packages/parameters/src/types/SecretsProvider.ts +++ b/packages/parameters/src/types/SecretsProvider.ts @@ -85,7 +85,9 @@ type SecretsGetOutput< ExplicitUserProvidedType = undefined, InferredFromOptionsType = undefined > = undefined extends ExplicitUserProvidedType - ? undefined extends InferredFromOptionsType | SecretsGetOptionsTransformNone + ? undefined extends InferredFromOptionsType + ? string | Uint8Array + : InferredFromOptionsType extends SecretsGetOptionsTransformNone ? string | Uint8Array : InferredFromOptionsType extends SecretsGetOptionsTransformBinary ? string