wip: 부대 편성 목록

This commit is contained in:
2022-07-27 15:15:42 +09:00
parent e55e73ab6f
commit c962039aaf
2 changed files with 111 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
export function convertIterableToMap<T extends object, K extends keyof T, V extends T[K] & (string | number | symbol)>(
values: Iterable<T>,
key: K
): Map<V, T> {
const result = new Map<V, T>();
for (const obj of values) {
result.set(obj[key] as V, obj);
}
return result;
}