chore(typings): remove StringMap
This was a poorly typed attempt to mimic TypeScript's index signatures, which we can use instead. This eliminates a very strange type that we were exposing to users, but not re-exporting through our public API. Fixes #4483
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {StringMap, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
/**
|
||||
* Supported http methods.
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
Map,
|
||||
MapWrapper,
|
||||
ListWrapper,
|
||||
StringMap
|
||||
} from 'angular2/src/core/facade/collection';
|
||||
|
||||
/**
|
||||
@@ -36,7 +35,7 @@ import {
|
||||
*/
|
||||
export class Headers {
|
||||
_headersMap: Map<string, string[]>;
|
||||
constructor(headers?: Headers | StringMap<string, any>) {
|
||||
constructor(headers?: Headers | {[key: string]: any}) {
|
||||
if (isBlank(headers)) {
|
||||
this._headersMap = new Map<string, string[]>();
|
||||
return;
|
||||
@@ -44,7 +43,7 @@ export class Headers {
|
||||
|
||||
if (headers instanceof Headers) {
|
||||
this._headersMap = (<Headers>headers)._headersMap;
|
||||
} else if (headers instanceof StringMap) {
|
||||
} else /*if (headers instanceof StringMap)*/ {
|
||||
this._headersMap = MapWrapper.createFromStringMap<string[]>(headers);
|
||||
MapWrapper.forEach(this._headersMap, (v, k) => {
|
||||
if (!isListLikeIterable(v)) {
|
||||
|
||||
Reference in New Issue
Block a user