Open
Description
Description
When updating the "reflect-metadata" package from 0.2.1 to 0.2.2, the value transformation defined in @Transform decorator does not execute.
This is a class I have defined in the code, which works with the previous version of "reflect-metadata".
import { Transform } from "class-transformer";
import moment from "moment-timezone";
export class Event {
id!: string;
visible!: boolean;
@Transform(({ value }: { value: string }) => moment.parseZone(value).toDate())
start!: Date;
@Transform(({ value }: { value: string }) => moment.parseZone(value).toDate())
end!: Date;
}
Expected behavior
Event.start
and Event.end
should be of type Date
, with the parsed timezone.
Actual behavior
Event.start
and Event.end
are not transformed string
types.