Helper to transform given mutable instance into flat object. Properties with undefined values are not copied.
the instance to introspect.
values of all properties;
const Clazz = declare({ firstName: "", lastName: ""});const instance = new Clazz({firstName:"Test"});const state = toObject(instance);//-> { firstName: "Test", lastName:"" } Copy
const Clazz = declare({ firstName: "", lastName: ""});const instance = new Clazz({firstName:"Test"});const state = toObject(instance);//-> { firstName: "Test", lastName:"" }
Helper to transform given mutable instance into flat object. Properties with undefined values are not copied.