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

fix(shared): LooseRequired typescript 4.7 error #6052 #6112

Closed
wants to merge 1 commit into from
Closed

fix(shared): LooseRequired typescript 4.7 error #6052 #6112

wants to merge 1 commit into from

Conversation

mioxs
Copy link

@mioxs mioxs commented Jun 14, 2022

Fix #6052

@mioxs mioxs changed the title fix(runtime-dom): LooseRequired typescript 4.7 error #6052 fix(shared): LooseRequired typescript 4.7 error #6052 Jun 14, 2022
@netlify
Copy link

netlify bot commented Jun 14, 2022

Deploy Preview for vuejs-coverage failed.

Name Link
🔨 Latest commit 9b2fe70
🔍 Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/62a88f40ebd282000897be69

@07akioni
Copy link
Contributor

I thinks it's better to add some unit tests to avoid further regression.

@mioxs
Copy link
Author

mioxs commented Jun 15, 2022

I have tested

@@ -5,7 +5,7 @@ export type UnionToIntersection<U> = (
: never

// make keys required but keep undefined values
export type LooseRequired<T> = { [P in string & keyof T]: T[P] }
export type LooseRequired<T> = { [P in keyof T]: T[P] }
Copy link
Member

Choose a reason for hiding this comment

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

This makes LooseRequired<T> equivalent to T. The original LooseRequired<T> is different because all keys of T are not optional. It is added to match vuejs/rfcs#293.

Copy link
Member

Choose a reason for hiding this comment

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

See the difference here.

@mioxs mioxs closed this Jun 18, 2022
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.

Prop required and starts with on's type is broken in ts 4.7
3 participants