Skip to content
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

Refactor enum values types #243

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Refactor enum values types #243

merged 1 commit into from
Dec 28, 2023

Conversation

elchininet
Copy link
Owner

The enum values types were using the enums' keys just because the keys and the values were the same, but it is better to get the string representation of the enums that returns the exact values.

Enum

enum Mode {
    combined = 'combined',
    override = 'override',
    diff = 'diff'
}

Enum values

// Before
type ModeValues = keyof typeof Mode; // 'combined' | 'override' | 'diff'

// After
type ModeValues = `${Mode}`; // 'combined' | 'override' | 'diff'

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 753cb51 on change_values_types
into bb59cce on master.

@elchininet elchininet merged commit 3558aae into master Dec 28, 2023
2 checks passed
@elchininet elchininet deleted the change_values_types branch December 28, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants