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

Suggestion: Deep Partial #53219

Closed
5 tasks done
kaikaibenkai opened this issue Mar 12, 2023 · 2 comments
Closed
5 tasks done

Suggestion: Deep Partial #53219

kaikaibenkai opened this issue Mar 12, 2023 · 2 comments

Comments

@kaikaibenkai
Copy link

Suggestion

🔍 Search Terms

Sometimes I have config files like

export default defineMyConfig({
  title: 'Hello, World!',
  database: {
    port: 5330,
    password: '12348765',
  },
});

defineMyConfig will deep merge the given config options and default config.

...But what's the given options' type? Partial<T> isn't deep.

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Adding a built-in type like DeepPartial<T>.

📃 Motivating Example

(in the fist paragraph)

💻 Use Cases

(in the fist paragraph)

@fatcerberus
Copy link

#51841 (comment)

@kaikaibenkai
Copy link
Author

Ok then...

@kaikaibenkai kaikaibenkai closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2023
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

No branches or pull requests

2 participants