@nativewrappers/client
Version:
Javascript/Typescript wrapper for the FiveM natives
15 lines (14 loc) • 390 B
JavaScript
export function* enumValues(enumObj) {
let isStringEnum = true;
for (const property in enumObj) {
if (typeof enumObj[property] === 'number') {
isStringEnum = false;
break;
}
}
for (const property in enumObj) {
if (isStringEnum || typeof enumObj[property] === 'number') {
yield enumObj[property];
}
}
}