TsObjectCreate
This is a very experimental library that uses code generation to create functions for creating objects. Currently it doesn't work in many scenarios so just don't use this yet.
Example
Setup
Say you have some classes like this:
// ./src/classes.ts
You could generate some code based on these classes:
; ; fs.writeFile"./src/objectFactory.ts", code;
Use
Then this would allow you to do the following:
// ./src/main.ts;; ; main instanceof Main; // truemain.other instanceof Other; // true // serialize it;// deserialize it; newMain instanceof Main; // truenewMain.other instanceof Other; // true