The items that will be addded in enum.
Returns an object with key and value.
Get the key name that will be used to create the ENUM object, this could be the item case the item is a string or the first element of array case the item is a array
The string or array that correspond to the current item
Return true case the items are valid, or false case there are no items
Get the value that will be used to create the ENUM object, this value could be the index number or a custom value sent in item array
The string or array that correspond to the current item
The current index that will be used case the user didn't send a custom value
Return true case the items are valid, or false case there are no items
Verify if the received items are valid to create an enum, emits an error case the items schema is invalid
The items that will be addded in enum.
Return true case the items are valid, or false case there are no items
An ENUM implementation in JS
import jsENUM from '@rxluz/js-enum';
const direction = jsENUM('UP', 'DOWN', 'LEFT', 'RIGHT');
const myDirection = direction.DOWN;
var jsENUM = require('@rxluz/js-enum').default;
const direction = jsENUM('UP', 'DOWN', 'LEFT', 'RIGHT');
const myDirection = direction.DOWN;
Returns an object with key and value.
Generated using TypeDoc
Creates the enum itself