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

Remove rest parameters from equals #104

Open
johannes-lindgren opened this issue Nov 25, 2024 · 0 comments
Open

Remove rest parameters from equals #104

johannes-lindgren opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
proposal A feature request that hasn't been accepted v1.0 Planned for the initial release
Milestone

Comments

@johannes-lindgren
Copy link
Owner

equals accept rest parameters:

equals('red', 'green', 'blue')

The question is: should we limit the number of arguments to exactly 1? For the example above, this would mean:

oneOf(
  equals('red'),
  equals('green'),
  equals('blue'),
)

It's more repetitive, but equals is mostly meant to be used for discriminated unions. Having exactly one argument would add simplicity and constitency.

@johannes-lindgren johannes-lindgren added the proposal A feature request that hasn't been accepted label Nov 25, 2024
@johannes-lindgren johannes-lindgren self-assigned this Nov 25, 2024
@johannes-lindgren johannes-lindgren changed the title Remove Remove rest parameters from equals Nov 25, 2024
@johannes-lindgren johannes-lindgren added the v1.0 Planned for the initial release label Nov 25, 2024
@johannes-lindgren johannes-lindgren added this to the v1.0 milestone Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal A feature request that hasn't been accepted v1.0 Planned for the initial release
Projects
None yet
Development

No branches or pull requests

1 participant