airship-server
Version:
Airship is a framework for Node.JS & TypeScript that helps you to write big, scalable and maintainable API servers.
24 lines (20 loc) • 512 B
text/typescript
import ClassField from "./ClassField";
export default class ClassScheme {
constructor(
readonly name: string,
readonly fields: ClassField[]
) {
}
public serialize(): Object {
return {
name: this.name,
fields: this.fields.map(f => f.serialize())
}
}
public static deserialize(raw: any): ClassScheme {
return new ClassScheme(
raw['name'],
raw['fields'].map(ClassField.deserialize)
)
}
}