diff --git a/package.json b/package.json index 301fbdd..d74472a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "atenv", - "version": "1.0.6", + "version": "1.0.7", "main": "dist/index.js", "license": "MIT", "dependencies": { diff --git a/src/lib/atenv.ts b/src/lib/atenv.ts index 0fe8edd..855b921 100644 --- a/src/lib/atenv.ts +++ b/src/lib/atenv.ts @@ -1,4 +1,4 @@ -import { classToClass, ClassTransformOptions } from 'class-transformer'; +import { ClassTransformOptions, instanceToInstance } from 'class-transformer'; import { validateSync, ValidatorOptions } from 'class-validator'; import { config, DotenvConfigOptions } from 'dotenv'; import { ENV_KEY, SECTION_KEY } from './constants'; @@ -61,7 +61,7 @@ export const parseEnv = (TClass: new () => T, options?: ParseEnvOptions) => { } } - const converted = classToClass(instance, { + const converted = instanceToInstance(instance, { exposeDefaultValues: true, ...options?.transformOptions, });