Introduce oneOf helpers function #2674
Labels
c: feature
Request for new feature
m: helpers
Something is referring to the helpers module
p: 1-normal
Nothing urgent
s: waiting for user interest
Waiting for more users interested in this feature
Milestone
Clear and concise description of the problem
Currently, if you want to select one of a few local values, you have to wrap them explicitly in an array before you can pass them to arrayElement.
Suggested solution
Introduce
faker.helpers.oneOf(...values: T[]): T
that hides the array creation from the user.Alternative
Stay with
arrayElement
only.Additional context
Definition
Usage with arrays
Usage with values
The text was updated successfully, but these errors were encountered: