Compile types inside objects with accessors in JS