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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK
S.URL
is not equivalent,z.string().url()
just validates a string:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema.Date
is also not an exact equivalent, but this fact didn't prevent it from being mentioned as an equivalent a few lines later:schema/comparisons.md L286-L307
And I think that's fine that they're not exactly equivalent and still mentioned because there's a value in it. When I first saw that there's no equivalent of URL validation, I was really confused, spent time reimplementing
Schema.URL
, and only after I was done, I noticed it actually existed and I created absolutely the same thing.I don't want this to happen to anybody else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't claim that they are equivalent, it shows what can be used in
Schema
when the input is a string. However, without proper description, that section is confusing and should be reorganized. Furthermore, since these docs were written, some things have changed (e.g.,Schema.URL
didn’t exist at the time). IMO, the entire document needs to be refactoredThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed it claimed they were equivalent because it didn't claim otherwise. In cases where Effect had no equivalent, it was stated as:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's not your fault, the document needs to be restructured, it's currently confusing