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

Rename .refine into .refineUnsafe #203

Closed
matwojcik opened this issue Jan 5, 2024 · 2 comments · Fixed by #204
Closed

Rename .refine into .refineUnsafe #203

matwojcik opened this issue Jan 5, 2024 · 2 comments · Fixed by #204
Labels
enhancement New feature or request

Comments

@matwojcik
Copy link
Contributor

Is your feature request related to a problem? Please describe.
.refine method does not indicate that it is unsafe - i.e. can throw exception. It is so easy to make a mistake by a developer when they don't know the library very well. I think one of the goals of libraries like this is to promote type safety and purity.

Describe the solution you'd like
I suggest in 3.x to rename it to refineUnsafe

@matwojcik matwojcik added the enhancement New feature or request label Jan 5, 2024
@Iltotore
Copy link
Owner

Iltotore commented Jan 6, 2024

Adding refineUnsafe to the next minor and marking refine as deprecated is also an option. Then, we can more safely remove refineUnsafe for 3.0.0.

@matwojcik
Copy link
Contributor Author

Adding refineUnsafe to the next minor and marking refine as deprecated is also an option. Then, we can more safely remove refineUnsafe for 3.0.0.

Definitely good idea. Prepared PR #204 that addresses this

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 a pull request may close this issue.

2 participants