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

Add a warning to the prune function #1205

Open
AlexRMU opened this issue Aug 7, 2024 · 4 comments · May be fixed by #1212
Open

Add a warning to the prune function #1205

AlexRMU opened this issue Aug 7, 2024 · 4 comments · May be fixed by #1212
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@AlexRMU
Copy link
Contributor

AlexRMU commented Aug 7, 2024

The TS allows you to pass arguments with an extended type. As a result, the shape of the object changes but its type does not.

playground

This cannot be fixed at the moment.

https://stackoverflow.com/questions/76490186/use-type-parameters-with-exact-type-instead-of-extending

Therefore, I suggest adding a warning about this.

@samchon samchon added the documentation Improvements or additions to documentation label Aug 7, 2024
@samchon
Copy link
Owner

samchon commented Aug 7, 2024

If you wanna add @warning JSDocTag description, you can do it with PR.

@AlexRMU
Copy link
Contributor Author

AlexRMU commented Aug 8, 2024

You can also add a compile-time check that will generate ts warnings.

@samchon
Copy link
Owner

samchon commented Aug 8, 2024

You are meaning that generate compiler level warning message whenever calling typia.misc.prune<T>() functions?

I don't want that.

@AlexRMU
Copy link
Contributor Author

AlexRMU commented Aug 8, 2024

Not every time, but when necessary, when a generic is passed and it is not equal to the type of the argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants