a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Shared / getRandomEnumValue
getRandomEnumValue<
T>(enumType,valueType):T[keyofT]
Returns a random value from an enumerated type, filtered by the specified value type.
• T extends object
• enumType: T
The enumerated type object from which to select a random value.
• valueType: "string" | "number"
Specifies the type of the values to consider (‘string’ or ‘number’).
T[keyof T]
A random value from the enumerated type that matches the specified value type.