Version 0.3.0
New Features:
1. String Enums with Enhanced Options:
- Introduced the ability to transform string enum values based on specified casing styles.
- Available options:
snakeCase,camelCase,PascalCase,kebabCase,lowercase, anduppercase. - Example:
Enum.String({ casing: 'snakeCase' }).
- Available options:
- Added
transformoption for custom transformations of enum values.- Example: Transforming enum values into API endpoints:
const options = {
casing: 'kebabCase',
transform: (value) => `https://api.example.com/${value}`
};
const { userEndpoint } = Enum.String(options);
console.log(userEndpoint); // Outputs: "https://api.example.com/user-endpoint"
2. Enhanced Numeric Enums:
- Added
startIndexoption to start the numeric enum from a specific index. - Introduced a
stepoption to increment numeric values by a specific step (e.g., 2, 5, 10).- Example:
Enum.Numeric({ startIndex: 5, step: 2 }).
- Example:
3. Symbol Enums with Global Option:
- Added the ability to create global symbols using the
globaloption.- Example:
Enum.Symbol({ global: true }).
- Example: