UNPKG

@gameroom/kit

Version:

Node kit for the Gameroom API

16 lines (15 loc) 358 B
module.exports = class Enum { constructor(...data) { for (const [index, entry] of data.entries()) { if (entry instanceof Object) { for (const key of Object.keys(entry)) { this[key] = entry[key] this[entry[key]] = key } } else { this[entry] = index this[index] = entry } } } }