给定一个枚举,例如:
enum DistributionType {
Calculated = "Calculated",
Custom = "Custom",
None = "None",
}如何使用Faker.JS从它中选择一个随机枚举值?
const randomValue = faker.???参考资料:https://fakerjs.dev/
发布于 2022-10-30 14:52:52
最后,我做了这个,因为我没有看到任何具体的帮助为枚举。
const randomValue = faker.helpers.arrayElement(Object.values(DistributionType));https://stackoverflow.com/questions/74254069
复制相似问题