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

feat: add built-in support for TypeScript enums & readonly arrays in DataTypes.ENUM #16488

Merged
merged 5 commits into from
Sep 12, 2023

Conversation

ephys
Copy link
Member

@ephys ephys commented Sep 12, 2023

Pull Request Checklist

  • Have you added new tests to prevent regressions?
  • If a documentation update is necessary, have you opened a PR to the documentation repository?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Does the name of your PR follow our conventions?

Description Of Change

This PR adds support for using TypeScript enums as the list of allowed values in DataTypes.ENUM.

The enum must be a string enum and the values must be equal to their keys, as we do not do any sort of mapping. This may be changed in the future, this is only a small improvement.

It also accepts readonly arrays.

Closes #15253
Closes #15256

@WikiRik WikiRik added this pull request to the merge queue Sep 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2023
@WikiRik WikiRik added this pull request to the merge queue Sep 12, 2023
Merged via the queue into main with commit d2a1c2f Sep 12, 2023
51 checks passed
@WikiRik WikiRik deleted the ephys/support-ts-enum branch September 12, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To document
Development

Successfully merging this pull request may close these issues.

Allow readonly arrays for Enums
2 participants