hyperloris / tyson

A TypeScript serialization/deserialization library to convert objects to/from JSON
MIT License
26 stars 2 forks source link

Deserialization error when --optimization=true #3

Open JimiJones opened 5 years ago

JimiJones commented 5 years ago

Hello, I found a bug when I tried to use the angular project with production profile active. I figure that was because of the angular optimization active on that profile: I use some custom type adapter and when Tyson try to found the adapter for the deserialization it get wrong because of type hash who are equals and shouldn't (certainly because of the optimization which rename type with single letter for example). So because the use of the hash type in _typeTokenCache to get the adapter, it get the wrong type since hash type are equals for two different type.

Hoping I'm clear enough to help you to solve that bug :)

hyperloris commented 5 years ago

Hello Jimi, first of all thank you for your interest in the library. I will look into it in the next days and I'll let you know ;)