@calf/serializable
Version:
Serializable module of Calf framework.
42 lines (32 loc) • 912 B
text/typescript
// External modules
import { expect } from "chai";
// Import library
import { Property, PropertyType, Entity, Default, Required, Unique, Timestamp, SchemaParser, Extends } from "../lib/serializable";
class Human {
public height: number = 0;
}
class Thing {
public weight: number = 0;
}
class Person {
public age: number = 0;
<string>("Mr Smith")
public name?: string = undefined;
public hobbies?: string[] = [];
}
// EXPORT TEST
describe("Serializable", () => {
// Init parser
let parser = new SchemaParser();
console.log(parser.parse(Person));
});