Skip to main content
Default(defaultValue): PropertyDecorator
Defined in: packages/env/src/decorators/default.decorator.ts:15 Property decorator that supplies a fallback value when the environment variable is undefined or null.

Parameters

defaultValue

unknown The value to use when the property is absent.

Returns

PropertyDecorator

Remarks

Pairs with class-transformer’s @Expose and class-validator decorators. The default is deep-cloned via JSON.parse(JSON.stringify(…)) so objects are not shared between instances.