fix(http): Update types for TypeScript nullability support

This commit is contained in:
Miško Hevery
2017-03-24 09:55:16 -07:00
committed by Tobias Bosch
parent 86396a43e9
commit c36ec9bf60
18 changed files with 138 additions and 128 deletions

View File

@ -75,7 +75,7 @@ export class Request extends Body {
super();
// TODO: assert that url is present
const url = requestOptions.url;
this.url = requestOptions.url;
this.url = requestOptions.url !;
if (requestOptions.params) {
const params = requestOptions.params.toString();
if (params.length > 0) {
@ -88,13 +88,13 @@ export class Request extends Body {
}
}
this._body = requestOptions.body;
this.method = normalizeMethodName(requestOptions.method);
this.method = normalizeMethodName(requestOptions.method !);
// TODO(jeffbcross): implement behavior
// Defaults to 'omit', consistent with browser
this.headers = new Headers(requestOptions.headers);
this.contentType = this.detectContentType();
this.withCredentials = requestOptions.withCredentials;
this.responseType = requestOptions.responseType;
this.withCredentials = requestOptions.withCredentials !;
this.responseType = requestOptions.responseType !;
}
/**