feat: Support readonly options for Types.string and Types.number#956
Open
duncanbeevers wants to merge 1 commit intoplexinc:mainfrom
Open
feat: Support readonly options for Types.string and Types.number#956duncanbeevers wants to merge 1 commit intoplexinc:mainfrom
duncanbeevers wants to merge 1 commit intoplexinc:mainfrom
Conversation
0c4929a to
03347a6
Compare
avaly
approved these changes
Nov 6, 2024
03347a6 to
c0ccd19
Compare
nunomarks
approved these changes
Feb 14, 2025
avaly
reviewed
Feb 17, 2025
Comment on lines
+159
to
+164
| const options = { | ||
| maximum: 9, | ||
| minimum: 2, | ||
| multipleOf: 2, | ||
| }); | ||
| } as const; | ||
| types.number(options); |
Collaborator
There was a problem hiding this comment.
This does not to be defined as const. Please keep this options object inline.
Collaborator
Author
Collaborator
Author
|
I'm pretty sure the behavior of this test changes when it is transplanted
into main. Do you have a suggestion for a different way to check the new
behavior?
…On Mon, Feb 17, 2025, 1:02 AM Valentin Agachi ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/__tests__/types.test.ts
<#956 (comment)>:
> + const options = {
maximum: 9,
minimum: 2,
multipleOf: 2,
- });
+ } as const;
+ types.number(options);
This does not to be defined as const. Please keep this options object
inline.
—
Reply to this email directly, view it on GitHub
<#956 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABZR3XTEZOLOVSTEMHNYT2QGQTFAVCNFSM6AAAAABRJNVTKKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMRQGQZDEMZXGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
c0ccd19 to
a2616f4
Compare
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
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.

Although support was added for
readonlyvalues passed toTypes.enum, the same functionality was not added to theTypes.stringandTypes.numberenum options member.