-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I know this might be an odd question for a random library but, is there any way of forcing an engine to return the min or max value when using integer or real?
e.g.:
// force this to always return the min, 1
integer(1, 4);
// force this to always return the max, 4
integer(1, 4);I've looked at creating a custom engine, and if the next() method returns 0 it seems to always return the min value:
const engine = {
next() {
return 0;
},
};
integer(1, 4); // returns 1
integer(1, 4); // returns 1
integer(1, 4); // returns 1I'm assuming it works by returning the number from the range, by index of the response from next(). But I can't find a way of forcing the max value.
Metadata
Metadata
Assignees
Labels
No labels