What is ts-enum-util?
masterts-enum-util provides type-safe utilities for working with TypeScript enums and string/number literal union types. It is divided into two main functional areas:
- Enum Wrapper Utilities: Provides a wrapper around an enum (an "enum-like object") to perform run-time operations like retrieving keys/values, reverse lookups, and validation with full type inference.
- Enum Value Visitor/Mapper: Implements a visitor pattern for processing single enum values or union types. It acts like a type-safe
switchstatement that forces you to handle every possible case, preventing bugs when enums are updated.