This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @description | |
| * Creates a frozen enumeration object where each key maps to its own string value. | |
| * This is useful for defining a set of constant string values that can be referenced by name. | |
| * This also avoids defining an object with duplicated string values manually. | |
| * @template {string} T | |
| * @param {...T} values | |
| * @returns {{ [K in T]: K }} | |
| * @example | |
| * const Colors = Enum('Red', 'Green', 'Blue'); |