copy files

This commit is contained in:
2023-08-05 12:12:18 +00:00
parent 421d75f665
commit b88fdf85e1
66 changed files with 3852 additions and 5 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;
}