From d6a2501d8eeb30c8e6817bb9ce5da19d254c5db6 Mon Sep 17 00:00:00 2001 From: "val.istar.guo" Date: Sun, 21 Jan 2024 01:04:20 +0800 Subject: [PATCH] fix: transforme should before validate --- src/config.module.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.module.ts b/src/config.module.ts index cf1f451..c538530 100644 --- a/src/config.module.ts +++ b/src/config.module.ts @@ -40,14 +40,15 @@ export class ConfigModule extends ConfigurableModuleClass { if (value !== undefined) instance[key] = value } - const errors = await validate(instance) + const result = instanceToInstance(instance) + const errors = await validate(result) if (errors.length) { Logger.error(errors.map((error) => error.toString()).join('\n')) throw new Error(errors.map((error) => error.toString()).join('\n')) } - return instanceToInstance(instance) + return result }, } }