CORPORATION: Corp changes prior to 2.3 finalization (#503)

This commit is contained in:
Snarling
2023-05-15 18:06:57 -04:00
committed by GitHub
parent e2e9b084bc
commit 2ae3ac52f1
135 changed files with 3106 additions and 3582 deletions
-18
View File
@@ -1,18 +0,0 @@
/**
* Utility function that creates a "city map", which is an object where
* each city is a key (property).
*
* This map uses the official name of the city, NOT its key in the 'Cities' object
*/
import { Cities } from "./Cities";
export function createCityMap<T>(initValue: T): Record<string, T> {
const map: Record<string, T> = {};
const cities = Object.keys(Cities);
for (let i = 0; i < cities.length; ++i) {
map[cities[i]] = initValue;
}
// round try JSON so to make sure none of the initial values have the same references.
return JSON.parse(JSON.stringify(map));
}