Given an enumeration such as:
enum DistributionType {
Calculated = "Calculated",
Custom = "Custom",
None = "None",
}
How do I use Faker.JS to pick a random enum value from it?
const randomValue = faker.???
Reference: https://fakerjs.dev/
For @faker-js/faker > 8.0.0 you can now also use the following helper:
const randomValue = faker.helpers.enumValue(DistributionType);