forked from angular/angular
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(http): move destructuring inside {Request,Response}Options ctor
Previously the RequestOptions/ResponseOptions classes had constructors with a destructured argument hash (represented by the {Request,Response}OptionsArgs type). This type consists entirely of optional members. This produces a .d.ts file which includes the constructor declaration: constructor({param, otherParam}?: OptionsArgs); However, this declaration doesn't type-check properly. TypeScript determines the actual type of the hash parameter to be OptionsArgs | undefined, which it then concludes does not have a `param` or `otherParam` member. This is a bug in TypeScript ( microsoft/TypeScript#10078 ). As a workaround, destructuring is moved inside the method, where it does not produce broken artifacts in the .d.ts. Fixes angular#16663.
- Loading branch information
Showing
3 changed files
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters