Skip to main content
Latest
interface ClassTransformOptions
Re-export
import { type ClassTransformOptions } from "https://deno.land/x/class_transformer@v0.2.3-beta.1/mod.ts";

Options to be passed during transformation.

Properties

optional
strategy: "excludeAll" | "exposeAll"

Exclusion strategy. By default exposeAll is used, which means that it will expose all properties are transformed by default.

optional
excludeExtraneousValues: boolean

Indicates if extraneous properties should be excluded from the value when converting a plain value to a class.

optional
groups: string[]

Only properties with given groups gonna be transformed.

optional
version: number

Only properties with "since" > version < "until" gonna be transformed.

optional
excludePrefixes: string[]

Excludes properties with the given prefixes. For example, if you mark your private properties with "" and "__" you can set this option's value to ["", "__"] and all private properties will be skipped. This works only for "exposeAll" strategy.

optional
ignoreDecorators: boolean

If set to true then class transformer will ignore all @Expose and @Exclude decorators and what inside them. This option is useful if you want to kinda clone your object but do not apply decorators affects.

optional
targetMaps: TargetMap[]

Target maps allows to set a Types of the transforming object without using @Type decorator. This is useful when you are transforming external classes, or if you already have type metadata for objects and you don't want to set it up again.

optional
enableCircularCheck: boolean

If set to true then class transformer will perform a circular check. (circular check is turned off by default) This option is useful when you know for sure that your types might have a circular dependency.

optional
enableImplicitConversion: boolean

If set to true then class transformer will try to convert properties implicitly to their target type based on their typing information.

DEFAULT: false