Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban Map types in JSON related functions. #653

Merged
merged 2 commits into from
Oct 12, 2023
Merged

Ban Map types in JSON related functions. #653

merged 2 commits into from
Oct 12, 2023

Conversation

samchon
Copy link
Owner

@samchon samchon commented Oct 12, 2023

In the below reason, typia banned Map types on the JSON related functions.

Following the policy of typia, nestia also bans such unsupported types on the JSON related functions.

When JSON.stringify() function be called about Map<Key, T> type, it always returns the empty bracket value {}. Until now, I'd developed typia to return the empty bracket value {}, following the standard JSON.stringify() function.

However, as most TypeScript/JavaScript developers do not know about that and there's not any problem when using the Map type on typia.json.stringify<T>() function ini the compile time, it was possible to misunderstand that typia's stringify function has a bug about the Map time.

In such reason, I've decided to throw a compile error when such non-supported type being used in the typia.json functions. Also, such strategy would be helpful for typia users to avoid taking a mistake using such non-supported type on the JSON functions.

In such reason, `typia` banned `Map` types on the JSON related functions. Following the policy of `typia`, `nestia` also bands such unsupported types on the JSON related functions.

> When `JSON.stringify()` function be called about `Map<Key, T>` type, it always returns the empty bracket value `{}`. Until now, I'd developed `typia` to return the empty bracket value `{}`, following the standard `JSON.stringify()` function.
>
> However, as most TypeScript/JavaScript developers do not know about that and there's not any problem when using the `Map` type on `typia.json.stringify<T>()` function ini the compile time, it was possible to misunderstand that `typia`'s stringify function has a bug about the `Map` time.
>
> In such reason, I've decided to throw a compile error when such non-supported type being used in the `typia.json` functions. Also, such strategy would be helpful for `typia` users to avoid taking a mistake using such non-supported type on the JSON functions.

- Related PR of `typia`: samchon/typia#844
@samchon samchon added the enhancement New feature or request label Oct 12, 2023
@samchon samchon self-assigned this Oct 12, 2023
@samchon samchon merged commit d7df724 into master Oct 12, 2023
@samchon samchon deleted the features/json branch October 12, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant