Skip to content

Instantly share code, notes, and snippets.

.
import { plainToInstance } from "class-transformer";
type Constructor<T> = new () => T;
// Helpers that *do not* change your base types
type FormatCtrFor<T> =
T extends (infer U)[] ? ReadonlyArray<Constructor<U>> :
Constructor<T>;