-
-
Notifications
You must be signed in to change notification settings - Fork 949
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
docs: fix unwrap literal union #1752
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #1752 +/- ##
=======================================
Coverage 99.64% 99.64%
=======================================
Files 2340 2340
Lines 242669 242669
Branches 1112 1112
=======================================
Hits 241819 241819
Misses 829 829
Partials 21 21 |
Would there be value in having the generated HTML documents (like ./docs/.vitepress/dist) included in the repo? Then when changes like this are made, it would be easy to see the effect of the changes (effectively a snapshot test). |
|
Waiting for #1755 |
For anybody interested in reviewing this: docs diffDocumentation changes detected:
(Parameter or return type changed, diff created by #1755) (generated for 310c78c) |
Restore the unwrapping of literal unions (broken due to the
readonly
array modifier/type operator).value: LiteralUnion<'a' | 'b'>
->'a' | 'b' | string
namedValue: LiteralUnion<AB>
->AB | string
array: readonly LiteralUnion<'a' | 'b'>[]
->readonly ('a' | 'b' | string)[]
namedArray: readonly LiteralUnion<AB>[]
->readonly (AB | string)[]
This also fixes an issue with missing parenthesis in union array types.
I found these issues when testing changes for #1732, but the PRs are unrelated to each other.
Preview Diff
Old
New
This mainly has an impact on the
string
module, but also affectsweightedArrayElement
(See also #1753).Preview Diff
->
(We might want to expand this similar to the usual options object in the future)
Note: We replace
LiteralUnions<X, Y>
withX | Y
because it is shorter and easier to understand (#811).