Revert "fix(http): Update types for TypeScript nullability support"

This reverts commit c36ec9bf60.

Broke in G3.
This commit is contained in:
Tobias Bosch
2017-04-17 09:48:11 -07:00
parent ea8ffc9841
commit 268884296a
18 changed files with 128 additions and 138 deletions

View File

@ -41,7 +41,7 @@ export class Headers {
_normalizedNames: Map<string, string> = new Map();
// TODO(vicb): any -> string|string[]
constructor(headers?: Headers|{[name: string]: any}|null) {
constructor(headers?: Headers|{[name: string]: any}) {
if (!headers) {
return;
}
@ -100,8 +100,7 @@ export class Headers {
this._headers.delete(lcName);
}
forEach(fn: (values: string[], name: string|undefined, headers: Map<string, string[]>) => void):
void {
forEach(fn: (values: string[], name: string, headers: Map<string, string[]>) => void): void {
this._headers.forEach(
(values, lcName) => fn(values, this._normalizedNames.get(lcName), this._headers));
}
@ -109,7 +108,7 @@ export class Headers {
/**
* Returns first header that matches given name.
*/
get(name: string): string|null {
get(name: string): string {
const values = this.getAll(name);
if (values === null) {
@ -158,7 +157,7 @@ export class Headers {
this._headers.forEach((values: string[], name: string) => {
const split: string[] = [];
values.forEach(v => split.push(...v.split(',')));
serialized[this._normalizedNames.get(name) !] = split;
serialized[this._normalizedNames.get(name)] = split;
});
return serialized;
@ -167,8 +166,8 @@ export class Headers {
/**
* Returns list of header values for a given name.
*/
getAll(name: string): string[]|null {
return this.has(name) ? this._headers.get(name.toLowerCase()) || null : null;
getAll(name: string): string[] {
return this.has(name) ? this._headers.get(name.toLowerCase()) : null;
}
/**