@pushrocks/smartjson
typed json handlers
Availabililty and Links
Status for master
Usage
Use TypeScript for best in class instellisense.
Classes
SmartJson makes it easy to fold and enfold classes into and from JSON
import { Smartjson, foldDec } from 'smartjson';
class AwesomeClass extends Smartjson {
static stringify
computedValue: string;
@foldDec()
anotherValueToStore: string = null;
constructor() {
super();
}
}
let myAwesomeInstance = new AwesomeClass();
let foldedObject = myAwesomeInstance.foldToObject();
myAwesomeInstance.enfoldFromObject({ anotherValueToStore: 'hi' });
foldedObject = myAwesomeInstance.foldToObject();
For further information read the linked docs at the top of this readme.
MIT licensed | © Lossless GmbH
| By using this npm module you agree to our privacy policy