Open
Description
version
"class-transformer": "0.2.3",
Example
import { Exclude, Expose, plainToClass } from 'class-transformer';
@Exclude()
class Test {
@Expose({groups: ['g1']})
a1: number;
@Expose({groups: ['g1', 'g2']})
a2: number;
@Expose()
a3: number;
}
console.log(plainToClass(Test, {a1: 1, a2: 2, a3: 3, a4: 4}, {ignoreDecorators: true}));
Result
Test {}
Expected:
Test { a1: 1, a2: 2, a3: 3, a4: 4 }