-
Notifications
You must be signed in to change notification settings - Fork 0
Fixes #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fixes #25
Conversation
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
- Add tests for JSON and TypeScript format outputs - Add tests for disabled enum maps - Add tests for partial output file configuration - Update json.test.ts to specify output filenames - Update test snapshots to reflect output file changes - Document enum mapping refactoring completion
- Document the purpose and implementation of enum utility generation - Explain the bidirectional lookup functionality - Provide usage examples and configuration options - Detail the AST generation process - Include performance considerations and best practices
- Add generateEnumToIntFunctions for string to number conversions - Add generateEnumToStringFunctions for number to string conversions - Add configuration options for unidirectional generation - Update store to support both bidirectional and unidirectional modes - Add comprehensive tests for new functionality - Update documentation to cover all three generation modes Benefits: - Cleaner, more precise TypeScript types - Better IDE support and IntelliSense - Smaller bundle sizes with tree-shaking - Slightly better performance for single-direction conversions
- Add generateEnumToIntFunctionsNested and generateEnumToStringFunctionsNested - Add outputFormat option: 'switchStatements' | 'nestedObjects' - Generate typed object maps with individual converter functions per enum - Update store logic to support both output formats - Add comprehensive tests for nested objects format - Update documentation with nested objects usage and benefits Benefits of nested objects format: - Better tree-shaking - import only specific enum converters - Direct property access without passing enum name - Type-safe enum property access - More modular code organization
- Add documentation for unidirectional enum conversion functions - Document nested objects output format option - Include examples for all three generation modes - Update features list to highlight new capabilities - Add configuration options table for new enum utility settings
- Add optional isNode boolean parameter to all generated helper methods
- When isNode is true, return wrapped object format: { TypeName: instance }
- When isNode is false/undefined, return raw type (backward compatible)
- Update return types to union of Type | { Type: Type }
- Update test snapshots to reflect new signatures
Benefits:
- Maintains backward compatibility (isNode defaults to false)
- Enables programmatic node type identification
- Useful for AST construction with embedded type information
- Type-safe with TypeScript union types
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.