transformable
Version:
Transforms plain objects to class instances and vice versa (a lightweight alternative to 'class-transformer')
6 lines (5 loc) • 310 B
TypeScript
export declare class Transformable {
static fromPlain<TargetClass extends typeof Transformable>(this: TargetClass, sourceObject: Object, sourceContext?: string): InstanceType<TargetClass>;
toPlain(targetContext?: string): Record<string, any>;
toJSON(targetContext?: string): Record<string, any>;
}