How to convert the string to the enum?
I looked this theme before and try to use that answer but it doesn't work in mine code (I commented the error message):
type ID = string;
export enum DbMapNames{
Document,
Level,
Node,
Condition,
Reference,
Connection
}
let map = new Map<DbMapNames, Map<ID, any>>(); // the map of the maps.
for(let n in DbMapNames){
// TS2345: Argument of type 'string' is not assignable to parameter of type 'DbMapNames'
if(!map.has(DbMapNames[n])) map.set(DbMapNames[n], new Map<ID, any>());
}