We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Partial<T>
key?: value
My suggestion meets these guidelines:
Better type indication for assignment to Partial<T>, or said key?: value
Before feat
interface IFoobar { a: number b: number c: number } function reproduce() { const foobar: Partial<IFoobar> = {} foobar.a = 42 foobar // Partial<IFoobar> foobar.b = 42 foobar // Partial<IFoobar> foobar.c = 42 foobar // Partial<IFoobar> }
After feat
interface IFoobar { a: number b: number c: number } function reproduce() { const foobar: Partial<IFoobar> = {} foobar.a = 42 foobar // Partial<IFoobar> & Pick<IFoobar, 'a'> foobar.b = 42 foobar // Partial<IFoobar> & Pick<IFoobar, 'a' | 'b'> foobar.c = 42 foobar // IFoobar }
The text was updated successfully, but these errors were encountered:
Essentially a duplicate of #42384; narrowing of properties doesnβt currently narrow parent objects.
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Suggestion
π Search Terms
Partial<T>
key?: value
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Better type indication for assignment to
Partial<T>
, or saidkey?: value
π Motivating Example
Before feat
π» Use Cases
After feat
The text was updated successfully, but these errors were encountered: