Reputation: 73
private itemsMap: Map<Array<string>,string> = new Map([
[['shp'], 'Shapefile'],
[['doc', 'docx'], 'Microsoft Word']
]);
Typescript doesn't like this, it gives me: "Argument of type '(string | string[])[][]' is not assignable to parameter of type 'Iterable<[{},{}]>"
This is a valid way to declare a "Map literal" though. Is there a way to do this that isn't going to cause an issue?
Upvotes: 3
Views: 4746
Reputation: 1419
What TypeScript version are using? This appears to work correctly with the current TypeScript version (currently 2.2.x).
Upvotes: 1