core/getRandomInRange accepts Min option greater than Max option
Closed this issue · 0 comments
theryansmee commented
Is this a regression?
No
Description
The following is currently valid:
getRandomInRange({ min: 1_000, max: 1 })
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
I would suggest throwing an error such as 'max must be greater than min'.
It's also probably worth writing some tests for this function as it is the centre pin to a lot of our functionality
Do you want to create a pull request?
Yes