Skip to content

Conversation

@godxiaoji
Copy link
Contributor

From #7619, increase the judgment of undefined value in withDefaults.

At the same time, according to the requirements of the document, ensures the returned props type has the optional flags removed for properties.

const res = withDefaults(
  defineProps<{
    str?: string;
    bool: boolean;
  }>(),
  {
    str: undefined,
    bool: undefined
  }
);

// res.str: string | undefined
// res.bool: boolean | undefined

@edison1105
Copy link
Member

Could you please resolve the conflicts?

@godxiaoji godxiaoji closed this Oct 26, 2024
@godxiaoji godxiaoji force-pushed the with-defaults-undefined branch from f503172 to ed01d92 Compare October 26, 2024 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready for review This PR requires more reviews scope: types

Projects

Status: Rejected

Development

Successfully merging this pull request may close these issues.

2 participants