json2typescript icon indicating copy to clipboard operation
json2typescript copied to clipboard

Fix compatibility issues

Open sparebytes opened this issue 8 years ago • 4 comments
trafficstars

  • Enable strict null checks
  • Add declaration files to source and npm package
  • Ignore source *.d.ts files in npm package

sparebytes avatar Sep 20 '17 19:09 sparebytes

Thanks for the great input!

Some of your commits were also suggested by the other pull requests, so I have integrated that already.

I am still thinking about the reflection integration. I have seen the approach when I created the package in the first place, but I decided not to go with any dependencies. On the other hand, it would be indeed much cleaner to use the reflection methods.

andreas-aeschlimann avatar Oct 15 '17 14:10 andreas-aeschlimann

I understand not wanting to add reflect-metadata as a dependency. I had run-time issues with the version I used because it clashed with Angular 2's version and presumably overwrote global variables that were already in use.

sparebytes avatar Oct 16 '17 20:10 sparebytes

One of the great benefits for the real-world-use is for sure that you do not have to write "=undefined" for each property. And of course, with reflect-metadata the code of json2typescript gets cleaner itself.

andreas-aeschlimann avatar Oct 16 '17 20:10 andreas-aeschlimann

@andreas-aeschlimann Do you plan to integrate reflect-metadata in the future? It will be great not have to use undefined for each property. Why not just use an internal copy as the PR is doing? You will have the control over the external dependency

jmesa-sistel avatar Feb 07 '19 09:02 jmesa-sistel