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: Support readonly options for Types.string and Types.number #956

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

duncanbeevers
Copy link
Contributor

Although support was added for readonly values passed to Types.enum, the same functionality was not added to the Types.string and Types.number enum options member.

Comment on lines +159 to +175
const options = {
maximum: 9,
minimum: 2,
multipleOf: 2,
});
} as const;
types.number(options);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not to be defined as const. Please keep this options object inline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct that this test case doesn't exercise any new readonly functionality. I'll revert this portion of the change.

In the subsequent test, the separate declaration is necessary.

image

@duncanbeevers
Copy link
Contributor Author

duncanbeevers commented Feb 17, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants