You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
function Enum(enum_name, ...values) {
|
|
const obj = Object.create(null);
|
|
for (const i of values)
|
|
obj[i] = Symbol(`${enum_name}.${i}`);
|
|
return Object.freeze(obj);
|
|
}
|