va-ts-model
v1.0.8
Published
Simple base abstract model based on TypeScript decorators and reflect-metadata which helps with serializing and deserializing data.
Downloads
2
Maintainers
Keywords
Readme
va-ts-model
Simple base abstract model based on TypeScript decorators and reflect-metadata which helps with serializing and deserializing data.
Creating models
class Animal extends Model {
@ModelProp()
dateOfBirth: Date;
@ModelProp(Date)
name: string;
}
class Dog extends Animal {
retrieve(): void {}
}
class Human extends Animal {
@ModelProp()
surname: string;
@ModelProp(Dog)
dogs: Dog[];
}