Open
Description
Search Terms
- autofill object literal
Suggestion
It would be nice if there was a way to automatically fill in the required values of an object literal so I don't have to do it one property at a time, it would set the value to a minimum value (string ''
, number 0
, etc). Then I can manually add the optional properties and there values.
Use Cases
This will help speed up creation of objects that have lots of required items.
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, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.