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 isNumber Predicate #2538

Closed
2 tasks
CMiksche opened this issue Mar 16, 2024 · 1 comment · Fixed by #2570
Closed
2 tasks

Add isNumber Predicate #2538

CMiksche opened this issue Mar 16, 2024 · 1 comment · Fixed by #2570
Labels
enhancement New feature or request
Milestone

Comments

@CMiksche
Copy link

Problem to solve

For checking if a return value is a number we have isFloat or isInteger. However I can't check if it is one of either.

I use some APIs where the return value can either be a float or integer - so in my case I just want to check if the return value is a number.

Proposal

For cases like this, I would love a new Predicate isNumber which can be used to check if the return value is some kind of number like float or integer.

Additionally, it would be nice to have some kind of OR or || operator - that would also solve this Issue because I would be able to write `isFloat OR isInteger

Tasks to complete

  • Create isNumber Predicate which should be valid if the response is either a float or integer
  • Add OR or || operator
@CMiksche CMiksche added the enhancement New feature or request label Mar 16, 2024
@jcamiel jcamiel added this to the 4.3.0 milestone Mar 28, 2024
@jcamiel
Copy link
Collaborator

jcamiel commented Mar 28, 2024

@CMiksche the predicate isNumber will be available in 4.3.0 (release soon), thanks @guerinoni for the PR

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