fix bug in corp

This commit is contained in:
Olivier Gagnon 2021-10-26 17:43:35 -04:00
parent ba72fd7fb5
commit f242bb5107
3 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -8,11 +8,12 @@ import { Cities } from "./Cities";
import { IMap } from "../types";
export function createCityMap<T>(initValue: T): IMap<T> {
const map: IMap<any> = {};
const map: IMap<T> = {};
const cities = Object.keys(Cities);
for (let i = 0; i < cities.length; ++i) {
map[cities[i]] = initValue;
}
return map;
// round try JSON so to make sure none of the initial values have the same references.
return JSON.parse(JSON.stringify(map));
}