fix(typings): repair broken type-checking for StringMap
Note that the previous type of StringMap was overly permissive and didn't catch errors. Also we have to explicitly type empty objects, which is explained here: https://github.com/Microsoft/TypeScript/issues/5089 Closes #4487
This commit is contained in:
@@ -44,7 +44,7 @@ export class Headers {
|
||||
if (headers instanceof Headers) {
|
||||
this._headersMap = (<Headers>headers)._headersMap;
|
||||
} else /*if (headers instanceof StringMap)*/ {
|
||||
this._headersMap = MapWrapper.createFromStringMap<string[]>(headers);
|
||||
this._headersMap = MapWrapper.createFromStringMap<string[]>(<{[key: string]: any}>headers);
|
||||
MapWrapper.forEach(this._headersMap, (v, k) => {
|
||||
if (!isListLikeIterable(v)) {
|
||||
var list = [];
|
||||
|
||||
Reference in New Issue
Block a user