@qlee/serializable
v0.0.2
Published
Json to Object
Downloads
1
Readme
serializable
Basic serialize
import { json, serializable } from "serializable";
@serializable
export class User {
public static serialize: (json: any) => User;
public deserialize: () => Map<String, any>;
@json('user_name')
public userName: string;
@json()
public age: number;
}
const user = User.serialize({user_name: 'Hello world', age: 10})
user.userName // => 'Hello world';
user.age // => 10;