I'm trying to create a Map
object from a string,function
dictionnary.
const entityTagDictionnary = [
['GRAPH_ADD_PROPERTY_SUBTYPE', (entity) => {
console.log('addSubtype called!');
return entity;
}],
['GRAPH_IGNORE_PROPERTY_SENTENCE', (entity) => {
console.log('ignore property called!');
return entity;
}],
['GRAPH_FORMAT_DATES', (entity) => {
console.log('formatDates called!');
return entity;
}],
];
const entityMap : Map<string, Function> = new Map(entityTagDictionnary);
I've got the following error:
Argument of type '(string | ((entity: any) => any))[][]' isn't matching the argument 'Iterable<[string, Function]>'.
Am I doing anything wrong?