Skip to main content
Version: Next

List To Enum

Create an enum object based on a list.

Description

Transforms a list into an enum.


The function creates a new local enum object, and iterates on each item of the provided list. For each item the transformer creates a new enum element.

Inputs

  • list (List): The list to iterate on.
  • transformer (List To Enum Transformer): The function that transforms a list item to an enum value.
    Inputs:
    - item (Object): The current list item to transform.
    - rank (Number): The rank of the current item.

    Outputs:
    - value (String): The key value of the enum element to be created.
    - name (String): The display name of the enum element.
    - rank (Number): The rank of the enum element.

Outputs

  • enum (Enum): The created enum.