The types for transformAndValidate is declared as:
export declare function transformAndValidate<T extends object>(classType: ClassType<T>, object: object, options?: TransformValidationOptions): Promise<T>;
Where the return is typed as <T>
However, if the return of transformAndValidate is an array of transformed instances then you need t do something like this to get the typing correct:
The types for
transformAndValidate
is declared as:export declare function transformAndValidate<T extends object>(classType: ClassType<T>, object: object, options?: TransformValidationOptions): Promise<T>;
Where the return is typed as
<T>
However, if the return of
transformAndValidate
is an array of transformed instances then you need t do something like this to get the typing correct:as unknown as InstanceClass[]