You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow to combine object shorthand notation with type conversions.
π Motivating Example
Using external libraries that are not typed very well.
functionmyFunc(type: string,data: unknown){if(someExternalFunction(data)){// here it's known that `data` is a stringsomeOtherFunction({ type,data: dataasstring});}}
It would be nice to be able to shorten this to
someOtherFunction({ type,dataas string });
or
someOtherFunction({type,<string>data });
π» Use Cases
Just to make source code more concise.
The text was updated successfully, but these errors were encountered:
Suggestion
π Search Terms
object shorthand notation type assertion
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Allow to combine object shorthand notation with type conversions.
π Motivating Example
Using external libraries that are not typed very well.
It would be nice to be able to shorten this to
or
π» Use Cases
Just to make source code more concise.
The text was updated successfully, but these errors were encountered: