refactor: utilize type narrowing (#33075)

PR Close #33075
This commit is contained in:
Danny Skoog
2019-10-09 17:17:52 +02:00
committed by Miško Hevery
parent 1ae77da609
commit 6ab5f3648a
29 changed files with 73 additions and 80 deletions

View File

@ -457,7 +457,7 @@ export class HttpClient {
if (first instanceof HttpRequest) {
// It is. The other arguments must be undefined (per the signatures) and can be
// ignored.
req = first as HttpRequest<any>;
req = first;
} else {
// It's a string, so it represents a URL. Construct a request based on it,
// and incorporate the remaining arguments (assuming `GET` unless a method is
@ -477,7 +477,7 @@ export class HttpClient {
if (options.params instanceof HttpParams) {
params = options.params;
} else {
params = new HttpParams({ fromObject: options.params } as HttpParamsOptions);
params = new HttpParams({fromObject: options.params});
}
}
@ -1798,7 +1798,7 @@ export class HttpClient {
}): Observable<Blob>;
/**
* Constructs a `PATCH` request that interprets the body as as a text string and
* Constructs a `PATCH` request that interprets the body as a text string and
* returns the response as a string value.
*
* @param url The endpoint URL.