enum_map

Returns a thing with key/value pairs for all the members of a given enum.

This function does not generate a change.

Function

enum_map(enum)

Arguments

Argument Type Description
enum str The name of the enum to return as a thing.

Return value

Returns a thing with key/value pairs for all the members of the given enumerator.

Example

This code shows the output of enum_map():

// Just a simple enum as an example
set_enum('Color', {
    RED: '#ff0000',
    GREEN: '#00ff00',
    BLUE: '#0000ff',
});

// Return enum as thing
enum_map('Color');

Example return value in JSON format

{
    "RED": "#ff0000",
    "GREEN": "#00ff00",
    "BLUE": "#0000ff"
}