forked from MapComplete/MapComplete
Update language translations
This commit is contained in:
parent
6252c4e888
commit
4247c166c9
3 changed files with 379 additions and 354 deletions
7
Utils.ts
7
Utils.ts
|
@ -919,12 +919,15 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
|
||||
public static MapToObj<T>(d: Map<string, T>, onValue: ((t: T, key: string) => any) = undefined): object {
|
||||
const o = {}
|
||||
d.forEach((value, key) => {
|
||||
const keys = Array.from(d.keys())
|
||||
keys.sort();
|
||||
for (const key of keys) {
|
||||
let value = d.get(key)
|
||||
if (onValue !== undefined) {
|
||||
value = onValue(value, key)
|
||||
}
|
||||
o[key] = value;
|
||||
})
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue