You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not a big fan it space indentation as I have a strong preference on tabs :-).
The TypeScript declaration currently defines ITypedJSONSettings.indent as number | null; I'm suggesting to change that to number | string | null.
As far as I can tell, nothing else needs to be changed as all you're doing with the indent property is pass it as 3rd parameter to JSON.stringify, which already accepts number | string as the "space" parameter.
The text was updated successfully, but these errors were encountered:
For anyone blocked by TypedJSON issues: my own software heavily relied on TypedJSON and had to apply numerous hacks for issues in TypedJSON that are not getting fixed. I loved TypedJSON but unfortunately had to move on as there has not been a single fix in 4 years now.
Therefore I created the similarly powerful library json-class-serializer heavily inspired by TypedJSON, which addresses all my issues (and hopefully yours). It's pretty much a drop-in replacement if you don't rely on reflect-metadata, which I'm not supporting (as this was the cause of most of my issues). If you rely on reflect-metadata, just specify the constructors of properties other than string/number/boolean and then it most likely just works.
Please feel free to give it a try if you feel the urge to move away from TypedJSON but don't want to do any heavy re-engineering. And please don't hate on me for the advertisement here as I have contributed to TypedJSON as well and opened many still-open issues :-).
You can find my library at @sumbricht/json-class-serializer and gladly open issues there if you feel something's missing / not working correctly.
I'm not a big fan it space indentation as I have a strong preference on tabs :-).
The TypeScript declaration currently defines ITypedJSONSettings.indent as number | null; I'm suggesting to change that to number | string | null.
As far as I can tell, nothing else needs to be changed as all you're doing with the indent property is pass it as 3rd parameter to JSON.stringify, which already accepts number | string as the "space" parameter.
The text was updated successfully, but these errors were encountered: